Skip to content

{ARM} az deployment: Support using none in .bicepparam parameter files#32750

Merged
yanzhudd merged 7 commits intoAzure:devfrom
polatengin:polatengin/bicepparam-using-none-support
Feb 6, 2026
Merged

{ARM} az deployment: Support using none in .bicepparam parameter files#32750
yanzhudd merged 7 commits intoAzure:devfrom
polatengin:polatengin/bicepparam-using-none-support

Conversation

@polatengin
Copy link
Member

@polatengin polatengin commented Feb 5, 2026

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 create

Description

Bicep now supports using none in .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 .bicepparam files to reference a specific .bicep template via a using '...' declaration.

This PR adds support for using none in .bicepparam files by:

  • Adding is_using_none_bicepparam_file() to _bicep.py that parses the first non-comment, non-empty line to detect the using none declaration

  • Modifying _prepare_deployment_properties_unmodified() in custom.py to handle the using none case: instead of passing --bicep-file to bicep build-params (which returns templateJson: null for using none), it builds the parameters and template separately

  • With using none, both .bicep and .jsontemplates are accepted via--template-file`

  • Existing behavior for .bicepparam files with a normal using '...' declaration is fully preserved

Testing Guide

# Create a bicepparam file with 'using none'
echo "using none
param environment = 'dev'" > params.bicepparam

# Create a bicep template
echo "param environment string
output env string = environment" > main.bicep

# Deploy with using none bicepparam + bicep template
az deployment group create -g <rg> -f main.bicep --parameters params.bicepparam

History Notes

{ARM} az deployment group/sub/mg/tenant create: Support using none in .bicepparam parameter files to enable parameter file reuse across different template deployments


This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI review requested due to automatic review settings February 5, 2026 20:28
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Feb 5, 2026

️✔️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
️✔️postgresql
️✔️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

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Feb 5, 2026

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 5, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

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>

@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label Feb 5, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot added the ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group label Feb 5, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 detect using none declarations in .bicepparam files
  • Modified deployment logic to handle using none by 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.

@polatengin polatengin force-pushed the polatengin/bicepparam-using-none-support branch from 0a2bff4 to 4ea1eb4 Compare February 5, 2026 20:44
@yanzhudd yanzhudd changed the title [Resource] az deployment: Support 'using none' in .bicepparam parameter files [ARM] az deployment: Support using none in .bicepparam parameter files Feb 6, 2026
@yanzhudd yanzhudd changed the title [ARM] az deployment: Support using none in .bicepparam parameter files {ARM} az deployment: Support using none in .bicepparam parameter files Feb 6, 2026
@yanzhudd
Copy link
Contributor

yanzhudd commented Feb 6, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@yanzhudd yanzhudd merged commit 8c0af97 into Azure:dev Feb 6, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

using none statement in bicepparam file crashes the Azure CLI with a Python Exception

4 participants