-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bicepparam Use Cases #11895
Labels
Comments
Usman0111
added a commit
that referenced
this issue
Oct 2, 2023
…1975) Enable `build-params` command to use values from a `BICEP_PARAMETERS_OVERRIDES` environment variable to update the `.bicepparam` file This work is to support the Inline overrides [use case for az cli](#11895) ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/11975)
'Can not use --parameters argument more than once when using a .bicepparam file.' Is this still in the roadmap to support (currently on 2.53.1 for CLI and 23.1 for bicep)? Not allowing this kind of makes using bicepparam files less than useful if you need to require 1 param to be passed in from a pipeline for example |
Yes it's still on the roadmap, see #11445 for more information. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
This issue contains all the supported/unsupported use cases we can have when using a
.bicepparam
file to make a deployment with Az CLI. It also contains correspondingbuild-params
Bicep CLI command that would invoked as part of the deployment. Note thatbuild-params
command produces in-memory JSON output for.bicep
template file,.bicepparam
params file and validates any supplemental parameters.Supported Cases section contains both cases that are currently supported and ones that will be supported in the future. The goal of this issue is to track/discuss these use cases asynchronously.
Supported Cases
Regular usage
Az CLI
Bicep CLI
params.bicepparam
main.bicep
Optional template file
CLI
az deployment group create \ --parameters 'params.bicepparam'
Bicep CLI
bicep build-params 'params.bicepparam'
params.bicepparam
main.bicep
Note: If no
using
declaration is present, we throw an error (from Bicep CLI)Optional Using
CLI
Bicep CLI
params.bicepparam
main.bicep
Note: If no
--template
value is given, we throw error (from Bicep CLI)Inline overrides
CLI
Bicep CLI
params.bicepparam
main.bicep
Validation Approach
Parameter override values are passed from Az CLI to Bicep CLI using an environment variable. Check the design gist for complete supplemental parameter validation strategy.
Restrictions
Az CLI allows ultimate flexibility when it comes to mix and matching parameter values. That is any type of parameter can provided in any order and latter always overrides the former. However, we have restricted this when a
.bicepparam
file is used:1 - The
.bicepparam
file must always be the first parameter for Az Cli2 - Only inline parameter overrides allowed (this might be relaxed in future to allow JSON files as well)
Module registry reference
CLI
Bicep CLI
bicep build-params 'params.bicepparam'
params.bicepparam
Unsupported Cases
Multiple bicepparam arguments
CLI
This would add a lot of implementation complexity, and we will instead by providing users the ability to solve this problem via
import
statements in the future.The text was updated successfully, but these errors were encountered: