Azure CLI shows a policyDefinitionReferenceId that does not exist in the policySetDefinition #31028
Labels
ARM
az resource/group/lock/tag/deployment/policy/managementapp/account management-group
Auto-Assign
Auto assign by bot
Azure CLI Team
The command of the issue is owned by Azure CLI team
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Describe the bug
There is a discrepancy between the information displayed in Azure CLI and Azure Portal regarding a specific policy exemption reference ID.
Related command
✔ az version
{
"azure-cli": "2.70.0",
"azure-cli-core": "2.70.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"account": "0.2.5",
"managementpartner": "1.0.0",
"resource-graph": "2.1.1"
}
}
Steps to Reproduce
az policy set-definition show --name ""
--query "policyDefinitions[*].policyDefinitionReferenceId" -o json | grep -i functionAppsShouldHaveClientCertificatesEnabledMonitoringEffect
List the existing policy exemptions via Azure CLI:
Expected Behavior
Azure CLI should return the same policy reference ID as the one listed in the initiative and the Azure Portal UI.
Actual Behavior
Azure CLI returns functionAppsShouldHaveClientCertificatesEnabledMonitoringEffect, which does not exist in the initiative anymore.
Possible Cause
Errors
Issue Summary
There is a discrepancy between the information displayed in Azure CLI and Azure Portal regarding a specific policy exemption reference ID in the initiative:
📌 Policy Set Definition (Initiative) ID:
/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8
Issue script & Debug output
Steps to Reproduce
az policy set-definition show --name "1f3afdf9-d0c9-4c3d-847f-89da613e70a8"
--query "policyDefinitions[*].policyDefinitionReferenceId" -o json | grep -i functionAppsShouldHaveClientCertificatesEnabledMonitoring
List the existing policy exemptions via Azure CLI:
az policy exemption list --scope "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
--query "[?policyAssignmentId=='/providers/microsoft.management/managementgroups/xxxxx/providers/microsoft.authorization/policyassignments/yyyyy']" -o json
Verify in Azure Portal:
Expected behavior
Azure CLI should return the same policy reference ID as the one listed in the initiative and the Azure Portal UI.
Actual Behavior
Azure CLI returns functionAppsShouldHaveClientCertificatesEnabledMonitoringEffect, which does not exist in the initiative anymore.
Possible Cause
Environment Summary
{
"azure-cli": "2.70.0",
"azure-cli-core": "2.70.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"account": "0.2.5",
"managementpartner": "1.0.0",
"resource-graph": "2.1.1"
}
}
Additional context
No response
The text was updated successfully, but these errors were encountered: