Skip to content
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

Can the bicep cli also have an option to build the corresponding json parameters file #2626

Closed
arjgupta opened this issue May 11, 2021 · 3 comments
Labels
enhancement New feature or request Needs: Triage 🔍

Comments

@arjgupta
Copy link

Is your feature request related to a problem? Please describe.
Right now the bicep cli can be used the build json templates from the bicep template. Can it be enhanced to build the parameters file for a template

Describe the solution you'd like
A clear and concise description of what you want to happen.

@alex-frankel
Copy link
Collaborator

alex-frankel commented May 11, 2021

We do plan to do this, but in the meantime I'd recommend the Bicep powershell module from @StefanIvemo. It already has the ability to generate a parameters file, but atm it requires building the bicep code as well. Since PS and CLI natively read .bicep files, the latter is not necessary. The good news is stefan is already planning to do this per the referenced issue, so hopefully soon we will have a clean way to do this.

Going to close this and track with #512 in the meantime.

@StefanIvemo
Copy link
Collaborator

StefanIvemo commented May 12, 2021

Just released version 1.4.6 of the Bicep PowerShell module. We do now support generating parameter files without transpiling the Bicep file to ARM.

# Generate a parameter file with all parameters from the bicep file
New-BicepParameterFile -Path .\main.bicep -Parameters All
or
# Generate a parameter file with required parameters from the bicep file only
New-BicepParameterFile -Path .\main.bicep -Parameters Required

This will generate an ARM template parameter file that can be used for deployment:

az deployment sub create -f main.bicep -p main.parameters.json -l eastus -c

https://www.powershellgallery.com/packages/Bicep

@AvinashRamireddy31
Copy link

Just released version 1.4.6 of the Bicep PowerShell module. We do now support generating parameter files without transpiling the Bicep file to ARM.

# Generate a parameter file with all parameters from the bicep file
New-BicepParameterFile -Path .\main.bicep -Parameters All
or
# Generate a parameter file with required parameters from the bicep file only
New-BicepParameterFile -Path .\main.bicep -Parameters Required

This will generate an ARM template parameter file that can be used for deployment:

az deployment sub create -f main.bicep -p main.parameters.json -l eastus -c

https://www.powershellgallery.com/packages/Bicep

Do we have the same using az cli?

@ghost ghost locked as resolved and limited conversation to collaborators May 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

4 participants