Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.

Home Page:https://aka.ms/azd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Issue] `azd up` & `azd provision` with bicep parameters?

justinyoo opened this issue · comments

Output from azd version

azd version 1.9.2 (commit c58b02f71710960aba28f81f3698e64cfdda9f96)

Describe the bug

It's not a bug but a feature request. azd provision relies on the bicep template. When I run the bicep template using the az CLI command, it should look like:

az deployment sub create \
    -n <NAME> \
    -l <LOCATION> \
    --template-file ./infra/main.bicep \
    --parameters environmentName=$AZURE_ENV_NAME \
    --parameters location=<LOCATION> \
    --parameters <PARAMETER_KEY_1>=<PARAMETER_VALUE_1> \
    ...

However, there's no way to provide parameters while running either azd up or azd provision command. So, if I run either azd up or azd provision, can we add the --parameters option so that the parameter input prompt won't appear?

@justinyoo - azd supports setting Bicep parameters in the following ways:

  1. Interactive mode via a prompt from azd when a required parameter is missing a value
  2. By configuring main.parameters.json that supports environment variable substitutions along with default values.
  3. By configuring main.bicepparam (See Azure docs for more info)

By using either option 2 or 3 you could then dynamically set any referenced variables and avoid any interactive prompts.

Additionally having a parameter that can easily be set via a --parameters flag or similar is something that has been discussed but not available yet. Thanks for the feedback!

@wbreza Thanks for getting back to me!

I know all the options, but any of them goes slightly off.

  • I want to avoid the interactive mode
  • I want to provide some parameter values dynamically generated from somewhere

My current solution is either option 2 or 3, but I think my feature request is also a nice-to-have-feature to provide devs with better flexibility.

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!