[ARM] az deployment: Expose --validation-level parameter at all scopes for create, validate, and what-if subcommands#31747
Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| deployment create | cmd deployment create added parameter validation_level |
||
| deployment group create | cmd deployment group create added parameter validation_level |
||
| deployment group validate | cmd deployment group validate added parameter validation_level |
||
| deployment group what-if | cmd deployment group what-if added parameter validation_level |
||
| deployment mg create | cmd deployment mg create added parameter validation_level |
||
| deployment mg validate | cmd deployment mg validate added parameter validation_level |
||
| deployment mg what-if | cmd deployment mg what-if added parameter validation_level |
||
| deployment sub create | cmd deployment sub create added parameter validation_level |
||
| deployment sub validate | cmd deployment sub validate added parameter validation_level |
||
| deployment sub what-if | cmd deployment sub what-if added parameter validation_level |
||
| deployment tenant create | cmd deployment tenant create added parameter validation_level |
||
| deployment tenant validate | cmd deployment tenant validate added parameter validation_level |
||
| deployment tenant what-if | cmd deployment tenant what-if added parameter validation_level |
||
| deployment validate | cmd deployment validate added parameter validation_level |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
@zhoxing-ms I would appreciate some guidance on the linter failure. I've added help text to the |
There was a problem hiding this comment.
Pull Request Overview
This PR exposes the new validation_level parameter on az deployment commands across all scopes and adds end-to-end tests to validate its behavior.
- Adds a
DeploymentTestsWithValidationLeveltest class covering resource-group, subscription, management-group, and tenant scopes. - Updates recordings for tenant-scope deployment tests to include
validationLevelin request/response bodies.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py | Added DeploymentTestsWithValidationLevel for all scopes |
| src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_tenant_deployment_with_validation_level.yaml | New tenant-scope recording including validationLevel payloads |
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py:1278
- Consider adding a negative test case for an invalid
--validation-levelvalue to ensure that the CLI properly rejects unsupported inputs.
class DeploymentTestsWithValidationLevel(ScenarioTest):
|
@zhoxing-ms is this PR still on track to be in the next release? |
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
az deployment: Expose --validation-level parameter at all scopes for create, validate, and what-if subcommands
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Could you please resolve these CI issues? |
|
@jeskew Please note that Azure CLI will freeze the code on 07/29/2025 07:00 UTC for the upcoming release. If you want to catch this release train, please resolve these comments ASAP, otherwise this PR has to be postponed to next sprint. |
|
@zhoxing-ms The test that is failing in CI is failing on the
I was only able to get this test to pass by changing the line endings in the JSON scenario file with |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 31747 in repo Azure/azure-cli |
|
@yanzhudd @yonzhan @jsntcy @zhoxing-ms Could you rerun the tests? |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Actually, I need to clarify that this is not a issue from dev branch code, but rather because the dev branch recently upgraded the SDK version with new api-version for template_stpecs @jeskew Therefore, you need to first pull the code of the latest dev branch, and then reinstall the corresponding Python SDK |
@jeskew So this is essentially a recording YAML issue caused by not installing the latest version of Python SDK locally, and currently there may be 3 and a half hours left to solve this CI issue for you, otherwise we won't be able to catch up with the release train of this sprint and will have to postpone it to the next sprint |
f4c597e to
8fd6723
Compare
|
@zhoxing-ms OK, I removed my commit that rerecorded the test since the recording on |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |



Related command
az deploymentDescription
This PR adds a new parameter
validation_levelto theaz deploymentcommands. This parameter is present on the SDK models used by the CLI but needs to be manually passed through in theaz deploymentcommands.Testing Guide
The parameter can be used on the
create,validate, andwhat-ifsubcommands at all scopes:History Notes
[ARM]
az deployment: Expose--validation-levelparameter at all scopes forcreate,validate, andwhat-ifsubcommandsThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.