Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
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>
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for using none in .bicepparam parameter files, enabling parameter file reuse across different Bicep/JSON templates. Previously, .bicepparam files required a using '...' declaration pointing to a specific Bicep template. The new feature allows users to specify using none and provide the template separately via --template-file.
Changes:
- Added
is_using_none_bicepparam_file()function to detectusing nonedeclarations in .bicepparam files - Modified deployment logic to handle
using noneby building parameters and templates separately - Added comprehensive tests for the new functionality including unit tests and integration tests
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/resource/_bicep.py | Added is_using_none_bicepparam_file() function to detect using none declarations by parsing the first non-comment, non-empty line |
| src/azure-cli/azure/cli/command_modules/resource/custom.py | Modified _prepare_deployment_properties_unmodified() to handle using none by building parameters and templates separately, accepting both .bicep and .json templates |
| src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py | Added unit tests for is_using_none_bicepparam_file() and integration tests for deployment commands with using none parameters |
| src/azure-cli/azure/cli/command_modules/resource/tests/latest/data/bicepparam/using_none_params.bicepparam | Test data file with basic using none declaration |
| src/azure-cli/azure/cli/command_modules/resource/tests/latest/data/bicepparam/using_none_with_comments_params.bicepparam | Test data file with using none and comments (not currently used in tests) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py
Outdated
Show resolved
Hide resolved
...and_modules/resource/tests/latest/data/bicepparam/using_none_with_comments_params.bicepparam
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource.py
Show resolved
Hide resolved
0a2bff4 to
4ea1eb4
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…test_resource.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
az deployment: Support using none in .bicepparam parameter files
az deployment: Support using none in .bicepparam parameter filesaz deployment: Support using none in .bicepparam parameter files
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Related command
az deployment group create,az deployment group validate,az deployment group what-if,az deployment sub create,az deployment mg create,az deployment tenant createDescription
Bicep now supports
using nonein .bicepparam files, allowing a single parameters file to be reused across multiple deployments with different Bicep/JSON templates. Previously, Azure CLI rejected this because it required.bicepparamfiles to reference a specific.biceptemplate via ausing '...'declaration.This PR adds support for
using nonein .bicepparam files by:Adding
is_using_none_bicepparam_file()to_bicep.pythat parses the first non-comment, non-empty line to detect theusing nonedeclarationModifying
_prepare_deployment_properties_unmodified()incustom.pyto handle theusing nonecase: instead of passing--bicep-filetobicep build-params(which returnstemplateJson: nullforusing none), it builds the parameters and template separatelyWith
using none, both.bicepand .jsontemplates are accepted via--template-file`Existing behavior for
.bicepparamfiles with a normalusing '...'declaration is fully preservedTesting Guide
History Notes
{ARM}
az deployment group/sub/mg/tenant create: Supportusing nonein .bicepparam parameter files to enable parameter file reuse across different template deploymentsThis 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.