Skip to content

Allow parameters to be omitted so they can be supplied at deploy-time #10454

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

Open
shenglol opened this issue Apr 17, 2023 · 11 comments · May be fixed by #16944
Open

Allow parameters to be omitted so they can be supplied at deploy-time #10454

shenglol opened this issue Apr 17, 2023 · 11 comments · May be fixed by #16944
Assignees
Milestone

Comments

@shenglol
Copy link
Contributor

Bicep version
196661b

Describe the bug
Currently, if a required parameter is not assigned a value in a .bicepparams file, a BCP258 error will be generated.
image

IMHO this should not be the expected behavior, since it is legit for a user to provide the value at deploy time via the Azure CLI / Azure PowerShell command prompt. The quick fix might be to change the error to a warning.

@alex-frankel
Copy link
Collaborator

alex-frankel commented Apr 21, 2023

Agree that we need to revisit this behavior given at least az CLI allows you to add parameters in the deployment command that are not present in the parameters file.

@stephaniezyen -- can we discuss this in the next bicep params sync?

@alex-frankel alex-frankel added this to the Committed Backlog milestone Apr 21, 2023
@stephaniezyen stephaniezyen changed the title BCP258 should be a warning instead of an error Allow parameters to be omitted so they can be supplied at deploy-time May 8, 2023
@stephaniezyen stephaniezyen removed their assignment May 8, 2023
@ggirard07
Copy link

+1 on this... I wanted to migrate from json parameter file but this is currently blocking me as I cannot omit secret parameters I want to seed in key vaults. With json parameter file, I could not specify those and set them from CLI instead.

@alex-frankel
Copy link
Collaborator

Closing as dup of #12019

@github-project-automation github-project-automation bot moved this from Todo to Done in Bicep Apr 23, 2024
@ggirard07
Copy link

ggirard07 commented Apr 23, 2024

@alex-frankel I quickly looked at the proposed scenario in #12019, but I do not see the use case specified in this issue explicitly listed in the scenario detailed in the linked issue. I probably missed it though...

@alex-frankel
Copy link
Collaborator

With the PR that @polatengin is implementing, you will be able to declare using null which will effectively turn off validation and then you will be able to use the parameters from that .bicepparam file supplemented with whatever values are missing that you pass on the command line. Does that sound like it will cover it @ggirard07? FWIW, I think we will demo this new feature in the next community call and you will have an opportunity to ask questions about the implementation.

@ggirard07
Copy link

ggirard07 commented Apr 24, 2024

@alex-frankel I doubt, especially according to statement "using null is valid only on shared bicepparam files and it turns off the parameter validation process on the file".
In our case, we do not have shared parameters, so we will not have such shared bicepparam file(s) where the usage of using null will be allowed (and according to comment, it is considered only for the shared file itself anyway).
We have instead a single parameter file containing most of the parameter values. But then we specify missing parameters from command line because those are values we do not want to store in git repo, neither we can retrieve those from Azure resource using bicep itself. Most of the time, they are secret variable groups stored in ADO.

@alex-frankel
Copy link
Collaborator

@ggirard07 - you were right :) We are going to get the first iteration out which will only allow using null in a shared file that must be consumed by the .bicepparam file used for the deployment.

@polatengin & @stephaniezyen are working on the ability to explicitly declare params which you know will be provided on the command line. Something like:

using 'main.bicep'

@providedWithDeployment()
param foo

Leaving this closed as Engin will decide if the details will be provided in #12019 or somewhere else.

@alex-frankel
Copy link
Collaborator

I'm going to reopen this one as it came up again and we don't have the design closed yet. I don't want to lose track of this.

@alex-frankel alex-frankel reopened this Jun 4, 2024
@stephaniezyen stephaniezyen moved this from Done to Todo in Bicep Oct 7, 2024
@stephaniezyen stephaniezyen modified the milestones: Committed Backlog, v0.31 Oct 7, 2024
@stephaniezyen stephaniezyen modified the milestones: v0.31, v0.32 Oct 30, 2024
@stephaniezyen stephaniezyen removed this from the v0.32 milestone Dec 11, 2024
@stephaniezyen stephaniezyen added this to the v0.33 milestone Dec 11, 2024
@polatengin polatengin modified the milestones: v0.33, v0.34 Jan 15, 2025
@ralfhecktor
Copy link

ralfhecktor commented Jan 28, 2025

@alex-frankel thanks for the effort on the topic. I kindly wanted to ask if there is any progress/roadmap on this topic?

@alex-frankel
Copy link
Collaborator

This got discussed yesterday actually. @stephaniezyen and @polatengin are working on a proposal to satisfy the requirements on this one. It's looking like there will be a few options that we will need some feedback on.

@stephaniezyen stephaniezyen moved this from Todo to In Progress in Bicep Feb 24, 2025
@stephaniezyen stephaniezyen modified the milestones: v0.34, v0.35 Mar 12, 2025
@rafajot1
Copy link

I would also expect to be possible to mix .bicepparam file along with the json file with additional parameters. An example scenario would be .bicepparam file with parameters kept in the source control and the json file with secrets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

7 participants