Describe the bug
We have pinned the version of the "Microsoft Cloud Security Benchmark V2" policy initiative to version 1.3.*-preview in our policy assignment.
{
"$schema": "https://raw.githubusercontent.com/Azure/enterprise-azure-policy-as-code/main/Schemas/policy-assignment-schema.json",
"nodeName": "root/Deploy-MCSB2-Monitoring",
"assignment": {
"name": "Deploy-MCSB2-Monitoring",
"displayName": "Microsoft Cloud Security Benchmark v2",
"description": "Microsoft Cloud Security Benchmark v2 policy initiative."
},
"definitionEntry": {
"displayName": "Microsoft Cloud Security Benchmark v2",
"policySetId": "/providers/Microsoft.Authorization/policySetDefinitions/e3ec7e09-768c-4b64-882c-fcada3772047"
},
"definitionVersion": "1.3.*-preview",
"enforcementMode": "Default",
"parameters": {},
"nonComplianceMessages": [
{
"message": "Microsoft Cloud Security Benchmark v2 must be met."
}
],
"scope": {
"epac-dev": [
"/providers/Microsoft.Management/managementGroups/epac-dev"
]
}
}
Everything works fine. We have deployed it without issues and the reference is 1.3.*-preview in the portal.
This policy initiative has since been updated to 1.4.* (We are not ready to upgrade to 1.4.* yet)
In this 1.4.* version of the policy initiative the following definition has been removed:
remove Policy Configure Azure AI Services resources to disable local key access (disable local authentication) (55eff01b-f2bd-4c32-9203-db285f709d30)
But it still exist in version 1.3.*-preview
If we then go ahead and create an exemption on the Microsoft Cloud Security Benchmark V2 on that specific policy, the Build-DeploymentPlans fails as the policy reference does no longer exist (Even though we have set the version to 1.3.*-preview where the policy reference should exist). See screenshot below.
My thoughts are that it does not respect the pinned version we have assigned and instead plans against the latest version of the policy initiative.
To Reproduce
- Create an assignment on Microsoft Cloud Security Benchmark V2 with version pinned to 1.3.*-preview
- Create an exemption on the following policy: "Configure Azure AI Services resources to disable local key access (disable local authentication)"
- Execute command:
Build-DeploymentPlans -PacEnvironmentSelector ${{ parameters.pacEnvironmentSelector }} -BuildExemptionsOnly -DevOpsType "ado" -InformationAction Continue
- Error
Expected behavior
Pipeline should succeed and exemption and plan show exemption to be created
Screenshots

EPAC Version
Latest
Describe the bug
We have pinned the version of the "Microsoft Cloud Security Benchmark V2" policy initiative to version 1.3.*-preview in our policy assignment.
Everything works fine. We have deployed it without issues and the reference is 1.3.*-preview in the portal.
This policy initiative has since been updated to 1.4.* (We are not ready to upgrade to 1.4.* yet)
In this 1.4.* version of the policy initiative the following definition has been removed:
remove Policy Configure Azure AI Services resources to disable local key access (disable local authentication) (55eff01b-f2bd-4c32-9203-db285f709d30)
But it still exist in version 1.3.*-preview
If we then go ahead and create an exemption on the Microsoft Cloud Security Benchmark V2 on that specific policy, the Build-DeploymentPlans fails as the policy reference does no longer exist (Even though we have set the version to 1.3.*-preview where the policy reference should exist). See screenshot below.
My thoughts are that it does not respect the pinned version we have assigned and instead plans against the latest version of the policy initiative.
To Reproduce
Build-DeploymentPlans -PacEnvironmentSelector ${{ parameters.pacEnvironmentSelector }} -BuildExemptionsOnly -DevOpsType "ado" -InformationAction ContinueExpected behavior
Pipeline should succeed and exemption and plan show exemption to be created
Screenshots

EPAC Version
Latest