[ARM] BREAKING CHANGE: Rewrite Azure Policy CRUD commands using auto-generation
Related command
az policy assignment {create, delete, list, show, update} az policy assignment identity {assign, remove, show} az policy assignment non-compliance-message {create, delete, list, show, update} az policy definition {create, delete, list, show, update} az policy exemption {create, delete, list, show, update} az policy set-definition {create, delete, list, show, update}
Description
Reimplement all azure policy CRUD commands using the auto-generation toolset with customization. Remove existing custom implementations.
There are a few breaking changes. PR for breaking change announcement is here: https://github.com/Azure/azure-cli/pull/31458
Testing Guide
All tests are updated and passing in record and playback modes. Few new tests added.
History Notes
[ARM] BREAKING CHANGE: policy assignment identity remove: Removing a user assigned identity will require providing the --mi-user-assigned switch
[ARM] BREAKING CHANGE: policy assignment identity assign: Replacing an existing identity will require first removing the existing identity
[ARM] BREAKING CHANGE: policy assignment non-compliance-message create: The return value will be the single created message object rather than the full array of message objects
[ARM] BREAKING CHANGE: policy assignment non-compliance-message delete: The return value will be empty rather than the full array of message objects
[ARM] BREAKING CHANGE: policy definition/set-definition delete: Bypassing the confirmation prompt will require providing the -y switch
[ARM] BREAKING CHANGE: policy exemption create/update: The date format of --expires-on will change slightly to ISO-8601, e.g. 2025-08-05T00:45:13Z instead of 2025-08-05T00:45:13+00:00
This checklist is used to make sure that common guidelines for a pull request are followed.
-
[X] The PR title and description has followed the guideline in Submitting Pull Requests.
-
[X] I adhere to the Command Guidelines.
-
[X] I adhere to the Error Handling Guidelines.
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13
❌AzureCLI-BreakingChangeTest
❌resource
rule cmd_name rule_message suggest_message ❌ 1007 - ParaRemove policy assignment create cmd policy assignment createremoved parameterskuplease add back parameter skufor cmdpolicy assignment create❌ 1007 - ParaRemove policy assignment update cmd policy assignment updateremoved parameterskuplease add back parameter skufor cmdpolicy assignment update❌ 1008 - ParaPropAdd policy assignment update cmd policy assignment updateupdate parametername: added propertyrequired=Trueplease remove property required=Truefor parameternameof cmdpolicy assignment update❌ 1007 - ParaRemove policy definition create cmd policy definition createremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy definition create❌ 1007 - ParaRemove policy definition delete cmd policy definition deleteremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy definition delete❌ 1007 - ParaRemove policy definition list cmd policy definition listremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy definition list❌ 1007 - ParaRemove policy definition show cmd policy definition showremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy definition show❌ 1007 - ParaRemove policy definition update cmd policy definition updateremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy definition update❌ 1008 - ParaPropAdd policy exemption create cmd policy exemption createupdate parameterexemption_category: added propertyrequired=Trueplease remove property required=Truefor parameterexemption_categoryof cmdpolicy exemption create❌ 1008 - ParaPropAdd policy exemption create cmd policy exemption createupdate parameterpolicy_assignment: added propertyrequired=Trueplease remove property required=Truefor parameterpolicy_assignmentof cmdpolicy exemption create❌ 1010 - ParaPropUpdate policy exemption list cmd policy exemption listupdate parameterdisable_scope_strict_match: updated propertyoptionsfrom['--disable-scope-strict-match', '-i']to['--disable-scope-strict-match', '-d']please change property optionsfrom['--disable-scope-strict-match', '-d']to['--disable-scope-strict-match', '-i']for parameterdisable_scope_strict_matchof cmdpolicy exemption list❌ 1007 - ParaRemove policy set-definition create cmd policy set-definition createremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy set-definition create❌ 1007 - ParaRemove policy set-definition delete cmd policy set-definition deleteremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy set-definition delete❌ 1007 - ParaRemove policy set-definition list cmd policy set-definition listremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy set-definition list❌ 1007 - ParaRemove policy set-definition show cmd policy set-definition showremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy set-definition show❌ 1007 - ParaRemove policy set-definition update cmd policy set-definition updateremoved parametersubscriptionplease add back parameter subscriptionfor cmdpolicy set-definition update
Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:
- Breaking changes can only be merged during the designated breaking change window
- A pre-announcement must be released at least one month in advance
For more details on how to introduce breaking changes, refer to the documentation: azure-cli/doc/how_to_introduce_breaking_changes.md
Thank you for your contribution! We will review the pull request and get back to you soon.
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.
Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). After that please run the following commands to enable git hooks:
pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Please refer to this guideline https://github.com/Azure/azure-cli/tree/dev/doc/authoring_command_modules#format-pr-title and specify the breaking changes included in this PR in the History Notes section.
Additionally, since you missed the Build Breaking Change Window, we can only postpone it to the Ignite Breaking Change Window to release it
Please refer to this guideline https://github.com/Azure/azure-cli/tree/dev/doc/authoring_command_modules#format-pr-title and specify the breaking changes included in this PR in the
History Notessection.
Updated
Additionally, since you missed the Build Breaking Change Window, we can only postpone it to the Ignite Breaking Change Window to release it
OK. What's the process for that?
@mentat9 Actually, what I want to ask is, could you specify which breaking changes are there? Because customers need to know the details of these breaking changes to help them better migrate usage
OK. What's the process for that?
This is the process https://github.com/Azure/azure-cli/blob/dev/doc/how_to_introduce_breaking_changes.md about how to introduce Breaking Changes
OK. What's the process for that?
This is the process https://github.com/Azure/azure-cli/blob/dev/doc/how_to_introduce_breaking_changes.md about how to introduce Breaking Changes
@zhoxing-ms - I believe we've done everything documented there. My question is what is the process for "postpone it to the Ignite Breaking Change Window to release it".
@mentat9 Actually, what I want to ask is, could you specify which breaking changes are there? Because customers need to know the details of these breaking changes to help them better migrate usage
OK, made the change.
@mentat9 Actually, we don't need to do anything more at the moment, but please remember to remind us to merge this PR before the Ignite Sprint, and you also need to clean up the previous pre-announcement at that time.
Update the history notes to be more in line with the specifications of CLI release notes
Could you please resolve these conflicts?
Additionally, as I mentioned earlier, due to the large number of breaking changes included in this PR, we can only wait for Ignite Sprint to merge and release it Before that, we may need to consider pre-announce these breaking changes: https://github.com/Azure/azure-cli/blob/dev/doc/how_to_introduce_breaking_changes.md#pre-announce-breaking-changes
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Commenter does not have sufficient privileges for PR 31496 in repo Azure/azure-cli
@kairu-ms - Can you run the automation again? I don't understand why it's waiting and why I can't run it myself.
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
May I ask if this PR is just a migration of CodeGen? Or are there any changes that customers can perceive (such as the release of new features or bug fixes)? If there are some changes in customer perception, please clearly state them in the history notes section of the PR description. such as:
May I ask if this PR is just a migration of CodeGen? Or are there any changes that customers can perceive (such as the release of new features or bug fixes)? If there are some changes in customer perception, please clearly state them in the history notes section of the PR description. such as:
No changes/features/fixes as far as users are concerned. The point of this PR is to modernize our toolset and move to auto generation of our CLI commands. We have a lot of new work planned: establishing this new baseline is the first stage.
Note: I just noticed my earlier push failed. I just pushed again to get my updates in. Sorry for any confusion.
/azp run

