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

pipeline additional vars secrs #3155

Merged
merged 16 commits into from
Feb 8, 2024

Conversation

vhvb1989
Copy link
Member

@vhvb1989 vhvb1989 commented Dec 21, 2023

This change adds support for projects to define additional variables or secrets to be set as part of the gh actions workflow or azdo pipelines.

fix: #1597

Strategy

Adding 2 new fields to azure.yaml for pipeline:

pipeline:
  variables:
    - var_foo
    - var_bar
   secrets:
     - sec_foo
     - sec_bar

With this configuration, azd will find variables within the azd-environment and set them as variables for the pipeline during azd pipeline config.
The same will happen with secrets, but the values from azd-environment are set as secrets on the pipeline.

other required changes

  • Call ensureParameters() during bicep_provider initialization. This change enables azd pipeline config to prompt for required parameters and gives the option to save the answer. When the answer is saved, it is used during CI/CD.
    This is a change that covers a similar scenario as the one we have for .NET Aspire, which prompts user to select what services to expose. But, instead of services to expose, azd ask the user for required bicep parameters w/o deploying.

  • Create memory cache for compile bicep and ensure parameters. Since we are compiling bicep during init and also checking parameters, we want to skip doing this again when a plan is created (within the same azd execution).

Copy link
Contributor

@weikanglim weikanglim left a comment

Choose a reason for hiding this comment

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

I really like that we're thinking about how to extend pipeline config beyond its current state. Overall, the feature by itself makes a ton of sense.

If I could wave a magic wand, the part I would be really curious about is how we can really streamline this entire process at a product level to make it a more cohesive experience.

For me, it seems like as a user:

  1. I have some metadata that defines required and optional inputs/parameters
  2. The environment is expected to supply these values

azd could be smart enough to say "Here's all the things you need to configure". This would work both for local deployments, and for CI deployments. In the current model, all these concepts are rather loose, which the user has to understand "local configuration" then "map to CI configuration".

@vhvb1989
Copy link
Member Author

the user has to understand "local configuration" then "map to CI configuration".

There are several and significant differences between local and CI. IMO, azd should not try to create cohesive experience.
As a user, I need to understand what I can do locally and from CI and what is needed for each scenario. I need to understand about:

  • Authentication models (service principal, roles, fed-credential... )
  • Continuous operations v/s one-time-operations. Like a sample which should run a script only the first time you provision, but never again (or on demand after the first time)
  • Difference between ENV VARS (locally) v/s secrets & variables (on CI)

@weikanglim
Copy link
Contributor

weikanglim commented Dec 26, 2023

I need to understand about:

  • Authentication models (service principal, roles, fed-credential... )

azd pipeline config handles this for you.

  • Continuous operations v/s one-time-operations. Like a sample which should run a script only the first time you provision, but never again (or on demand after the first time)

A user wants deployments to be repeatable. It should be repeatable on a local machine and on CI.

  • Difference between ENV VARS (locally) v/s secrets & variables (on CI)

A user cares about the sensitivity of values. Environment secrets vs. variables should exist as a general concept, even on a local environment. We currently don't do this but we should.

@vhvb1989 vhvb1989 mentioned this pull request Jan 3, 2024
Copy link
Member

@ellismg ellismg left a comment

Choose a reason for hiding this comment

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

Thanks for kicking this off, @vhvb1989. A few high level comments:

  • I'm really excited about the overall experience here. I think having our project guide folks through the configuration process of the pipeline is really useful. I'm glad we're spending some time here.

  • I'm wondering if we should merge the variables and secrets sections together in favor of a single group, and then have some secret: bool property on every value?

  • It would be nice if we could have some properties on each input? We might start with description to explain how the value is used?

  • If we go down that line, the values in azure.yaml here become more like inputs that can be configured with values that might default to something in the .env instead of just copying values from .env to azure.yaml. Is that better for us long term?

  • I'm nervous about additionalVariablesAsSecrets. I feel like this is a footgun that's going to lead to bad UX and people to do the wrong thing. Do you think we need it?

@vhvb1989
Copy link
Member Author

vhvb1989 commented Jan 3, 2024

Thank you @ellismg , let me add some thoughts here:

I'm wondering if we should merge the variables and secrets sections together in favor of a single group, and then have some secret: bool property on every value?

I considered this at the beginning. But, while it looks good for someone using only variables (and maybe just one secret only):

pipeline:
  variables:
    - foo
    - bar
    - other:
      - secret: true

I don't like how it looks for someone using only secrets, as it becomes very repetitive.

pipeline:
  variables:
    - foo:
      - secret: true
    - bar:
      - secret: true
    - other:
      - secret: true

That's why I decided to break it into a section for each, as a way to avoid the repetition (and extra lines).

It would be nice if we could have some properties on each input? We might start with description to explain how the value is used?

What would azd do with such description?
AzureDevOps does support/allow a description for variables, but GitHub does not. So, description would be scoped to the yaml file only, where, it can rather be just a comment:

pipeline:
  variables:
    # Need this to do foo on github...
    - foo
    - bar

If we go down that line, the values in azure.yaml here become more like inputs that can be configured with values that might default to something in the .env instead of just copying values from .env to azure.yaml. Is that better for us long term?

I don't really want to go that route. As it can open the risk of saving secrets on azure.yaml. The list of secrets/variables in azure.yaml should be an indirection to the values (similar to the Key Vault approach).
In the future, I would consider a new section KeyVaults where users can list the name of secrets to be set on the pipeline... (just future ideas).
But, azure.yaml must not contain input values

I'm nervous about additionalVariablesAsSecrets. I feel like this is a footgun that's going to lead to bad UX and people to do the wrong thing. Do you think we need it?

I think we need. It gives a flexible option to users with templates with a huge list of variables to just send it all to the pipeline. And, since we don't know if there might be sensitive info, I made it secrets only.
Here is an example: https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/infra/main.parameters.json#L29
The list of inputs for the bicep-infrastructure is huge, and it would be a pain to manually keep in sync the inputs to the azure.yaml for the pipeline config.
This field gives you the option to keep adding new inputs, and use them from your pipeline.

The next thing I want to do (eventually), is to use a go-template for the pipeline definition. Then, mapping the variables/secrets to the pipeline definition would also be done by azd :). And I want to let customers to update/use their own go-template to override the pipeline definition :)

@ellismg
Copy link
Member

ellismg commented Jan 3, 2024

That's why I decided to break it into a section for each, as a way to avoid the repetition (and extra lines).

Yeah - seeing this listed out in code does make it seem like separating them makes sense.

I think we need. It gives a flexible option to users with templates with a huge list of variables to just send it all to the pipeline. And, since we don't know if there might be sensitive info, I made it secrets only.

But I think this leads to bad outcomes. For example, if I look at the sample, I see that we'll end up setting resource group names as secrets, which means the CI output will be worse. I think we want to force authors to make a decision on if these values are secrets since we can't answer that question and defaulting to "secret" leads to a much worse experience.

What would azd do with such description?
AzureDevOps does support/allow a description for variables, but GitHub does not. So, description would be scoped to the > yaml file only, where, it can rather be just a comment:

I was thinking about this feature slightly differently than you. In my view, I was hoping it would be: "here's a set of values that need to be configured on the pipeline, and azd will help configure them (one strategy is by taking a value from .env where as you are coming from a "these values in .env are important to me, please ensure they get set on my CI pipeline" which is also reasonable. I think I'm fine with your design, but I still don't like the "additional as secrets" idea.

@vhvb1989
Copy link
Member Author

vhvb1989 commented Jan 4, 2024

@ellismg , let me do one last try in the name of "additional as secrets" idea

I see that we'll end up setting resource group names as secrets, which means the CI output will be worse.

The way it currently works is, only the env vars which are not included in the list of variables (that's where the additional comes from) are added as secrets. So, for the example you mentioned, if the user wants to use addionalValuesAsSecrets: true but there is one env-var which should be a variable (not a secret), the user just needs to explicitly add the env-var name to the variables list. Also, the azd-actual-known-variables ([env-name, sub-id, client-id, etc]), are automatically excluded from the values-as-secrets selection.

The fundamental issue I want to have a good story here is having a way to define the minimum (and really required) set of fields to define the pipeline vars/secrets.

If we take a look to the base customer's issue here: #1597 . The wish-list is a way to bulk the entire azd-env into gh pipeline secrets. We can even see they are currently trying things like azd env get-values | sed 's/="/=/' | sed 's/"$//' , which they can later pass to gh cli.
So, I would like to have a user experience that is good enough to cover from simple cases like:

  • Adding just one or two additional variables to the pipeline
  • Adding one secret and one variable
    To radical cases like:
  • Bulk all my azd-env as secrets to the pipeline (user does not care about showing **** on logs)
  • Select exactly which env-vars are values and set everything else as secrets.

What do you think? Can we try it :)

Another orthogonal fact:
There will be a session about using azd pipeline config for the openai-search-sample next Feb/24. I will be helping @pamelafox showing folks how to use azd to set up the template's pipeline on gh and ado. I want to show how azd can support the azd init + azd pipeline config to delegate all the process to a pipeline (instead of locally). If there's not a way to tell azd to set all env-vars as secrets, I will need to add all the inputs as a long list in azure.yaml... (which, IMO, will be super noisy :( ).

@ellismg
Copy link
Member

ellismg commented Jan 5, 2024

The fundamental issue I want to have a good story here is having a way to define the minimum (and really required) set of fields to define the pipeline vars/secrets.

I do think this is the crux of the issue. My concern here is that we are making it too easy for people to say the set of vars/secrets is "everything" without that actually being the right answer.

One thing I'm still struggling with is the fact that we use these vars and secrets for a lot of infrastructure configuration that would be controlled via azd env set (which is logically a read/write thing) on your local machine. These values don't get updated once you do a provision and won't persist from run to run. I'm not sure when we should be telling folks to use this strategy vs remote environments stored in Blob Storage. I think it is also a little strange that depending on when you run pipeline config stuff may or may not be yet set in your .env (maybe you haven't run provision yet?).

I think that the answer of "write some sed" for the "dump everything in the .env file into GH" is actually a decent answer. I could imagine adding more output format to azd env get-values to make this easier. I'm still not sure a "bulk add everything to GitHub" is the right move.

I think I would like it if we had a way to clearly state: "Here's the exact set of values that need to be configured on your pipeline" to make things work. I like that with what you have here I can look at a single place in azure.yaml and see this. I do think building out the configuration stuff you're describing makes sense, and I think that's a place that pipeline config can provide real value (in addition to management of the SP/OIDC connection to Azure).

I will need to add all the inputs as a long list in azure.yaml... (which, IMO, will be super noisy :( ).

I agree there will be a lot here - but I feel like this being self describing for us will be the right long term thing. We'll be able top build better tooling on top of stuff.

@vhvb1989
Copy link
Member Author

@ellismg , I have remove the all-vars-as-secrets functionality. Please take a look

@vhvb1989
Copy link
Member Author

@ellismg ping

Copy link
Member

@ellismg ellismg left a comment

Choose a reason for hiding this comment

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

Some small comments around the caching, but LGTM otherwise. Thanks as always for putting up with my feedback, @vhvb1989.

Copy link
Contributor

@wbreza wbreza left a comment

Choose a reason for hiding this comment

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

I don't have any issues with the code changes but would urge us to consider whether this is the approach we should be taking with regard to setting secrets in your pipeline.

Having this new secrets node under pipeline sets the precedent that your secrets should be available in the azd environment which is actually an anti-pattern.

Instead we should be thinking about how to leverage more secure secrets storage like keyvault.

cli/azd/pkg/project/project_config.go Show resolved Hide resolved
@azure-sdk
Copy link
Collaborator

Azure Dev CLI Install Instructions

Install scripts

MacOS/Linux

May elevate using sudo on some platforms and configurations

bash:

curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155/uninstall-azd.sh | bash;
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155 --version '' --verbose --skip-verify

pwsh:

Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155/uninstall-azd.ps1' -OutFile uninstall-azd.ps1; ./uninstall-azd.ps1
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155/install-azd.ps1' -OutFile install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155' -Version '' -SkipVerify -Verbose

Windows

PowerShell install

powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155/uninstall-azd.ps1' > uninstall-azd.ps1; ./uninstall-azd.ps1;"
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155/install-azd.ps1' > install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155' -Version '' -SkipVerify -Verbose;"

MSI install

powershell -c "irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3155/azd-windows-amd64.msi' -OutFile azd-windows-amd64.msi; msiexec /i azd-windows-amd64.msi /qn"

Standalone Binary

MSI

Container

docker run -it azdevcliextacr.azurecr.io/azure-dev:pr-3155

Documentation

learn.microsoft.com documentation

title: Azure Developer CLI reference
description: This article explains the syntax and parameters for the various Azure Developer CLI commands.
author: alexwolfmsft
ms.author: alexwolf
ms.date: 01/25/2024
ms.service: azure-dev-cli
ms.topic: conceptual
ms.custom: devx-track-azdevcli

Azure Developer CLI reference

This article explains the syntax and parameters for the various Azure Developer CLI commands.

azd

The Azure Developer CLI (azd) is an open-source tool that helps onboard and manage your application on Azure

Options

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --docs         Opens the documentation for azd in your web browser.
  -h, --help         Gets help for azd.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

  • azd auth: Authenticate with Azure.
  • azd config: Manage azd configurations (ex: default Azure subscription, location).
  • azd deploy: Deploy the application's code to Azure.
  • azd down: Delete Azure resources for an application.
  • azd env: Manage environments.
  • azd hooks: Develop, test and run hooks for an application. (Beta)
  • azd init: Initialize a new application.
  • azd monitor: Monitor a deployed application. (Beta)
  • azd package: Packages the application's code to be deployed to Azure. (Beta)
  • azd pipeline: Manage and configure your deployment pipelines. (Beta)
  • azd provision: Provision the Azure resources for an application.
  • azd restore: Restores the application's dependencies. (Beta)
  • azd show: Display information about your app and its resources.
  • azd template: Find and view template details. (Beta)
  • azd up: Provision Azure resources, and deploy your project with a single command.
  • azd version: Print the version number of Azure Developer CLI.

azd auth

Authenticate with Azure.

Options

      --docs   Opens the documentation for azd auth in your web browser.
  -h, --help   Gets help for auth.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd auth login

Log in to Azure.

Synopsis

Log in to Azure.

When run without any arguments, log in interactively using a browser. To log in using a device code, pass
--use-device-code.

To log in as a service principal, pass --client-id and --tenant-id as well as one of: --client-secret,
--client-certificate, or --federated-credential-provider.

azd auth login [flags]

Options

      --check-status                           Checks the log-in status instead of logging in.
      --client-certificate string              The path to the client certificate for the service principal to authenticate with.
      --client-id string                       The client id for the service principal to authenticate with.
      --client-secret string                   The client secret for the service principal to authenticate with. Set to the empty string to read the value from the console.
      --docs                                   Opens the documentation for azd auth login in your web browser.
      --federated-credential-provider string   The provider to use to acquire a federated token to authenticate with.
  -h, --help                                   Gets help for login.
      --redirect-port int                      Choose the port to be used as part of the redirect URI during interactive login.
      --tenant-id string                       The tenant id or domain name to authenticate with.
      --use-device-code[=true]                 When true, log in by using a device code instead of a browser.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd auth logout

Log out of Azure.

Synopsis

Log out of Azure

azd auth logout [flags]

Options

      --docs   Opens the documentation for azd auth logout in your web browser.
  -h, --help   Gets help for logout.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config

Manage azd configurations (ex: default Azure subscription, location).

Synopsis

Manage the Azure Developer CLI user configuration, which includes your default Azure subscription and location.

Available since azure-dev-cli_0.4.0-beta.1.

The easiest way to configure azd for the first time is to run azd init. The subscription and location you select will be stored in the config.json file located in the config directory. To configure azd anytime afterwards, you'll use azd config set.

The default value of the config directory is:

  • $HOME/.azd on Linux and macOS
  • %USERPROFILE%.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.

Options

      --docs   Opens the documentation for azd config in your web browser.
  -h, --help   Gets help for config.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config get

Gets a configuration.

Synopsis

Gets a configuration in the configuration path.

The default value of the config directory is:

  • $HOME/.azd on Linux and macOS
  • %USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.

azd config get <path> [flags]

Options

      --docs   Opens the documentation for azd config get in your web browser.
  -h, --help   Gets help for get.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config list-alpha

Display the list of available features in alpha stage.

azd config list-alpha [flags]

Options

      --docs   Opens the documentation for azd config list-alpha in your web browser.
  -h, --help   Gets help for list-alpha.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config reset

Resets configuration to default.

Synopsis

Resets all configuration in the configuration path.

The default value of the config directory is:

  • $HOME/.azd on Linux and macOS
  • %USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable to the default.

azd config reset [flags]

Options

      --docs    Opens the documentation for azd config reset in your web browser.
  -f, --force   Force reset without confirmation.
  -h, --help    Gets help for reset.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config set

Sets a configuration.

Synopsis

Sets a configuration in the configuration path.

The default value of the config directory is:

  • $HOME/.azd on Linux and macOS
  • %USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.

azd config set <path> <value> [flags]

Examples

azd config set defaults.subscription <yourSubscriptionID>
azd config set defaults.location eastus

Options

      --docs   Opens the documentation for azd config set in your web browser.
  -h, --help   Gets help for set.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config show

Show all the configuration values.

Synopsis

Show all configuration values in the configuration path.

The default value of the config directory is:

  • $HOME/.azd on Linux and macOS
  • %USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.

azd config show [flags]

Options

      --docs   Opens the documentation for azd config show in your web browser.
  -h, --help   Gets help for show.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config unset

Unsets a configuration.

Synopsis

Removes a configuration in the configuration path.

The default value of the config directory is:

  • $HOME/.azd on Linux and macOS
  • %USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.

azd config unset <path> [flags]

Examples

azd config unset defaults.location

Options

      --docs   Opens the documentation for azd config unset in your web browser.
  -h, --help   Gets help for unset.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd deploy

Deploy the application's code to Azure.

azd deploy <service> [flags]

Options

      --all                   Deploys all services that are listed in azure.yaml
      --docs                  Opens the documentation for azd deploy in your web browser.
  -e, --environment string    The name of the environment to use.
      --from-package string   Deploys the application from an existing package.
  -h, --help                  Gets help for deploy.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd down

Delete Azure resources for an application.

azd down [flags]

Options

      --docs                 Opens the documentation for azd down in your web browser.
  -e, --environment string   The name of the environment to use.
      --force                Does not require confirmation before it deletes resources.
  -h, --help                 Gets help for down.
      --purge                Does not require confirmation before it permanently deletes resources that are soft-deleted by default (for example, key vaults).

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env

Manage environments.

Options

      --docs   Opens the documentation for azd env in your web browser.
  -h, --help   Gets help for env.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env get-values

Get all environment values.

azd env get-values [flags]

Options

      --docs                 Opens the documentation for azd env get-values in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for get-values.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env list

List environments.

azd env list [flags]

Options

      --docs   Opens the documentation for azd env list in your web browser.
  -h, --help   Gets help for list.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env new

Create a new environment and set it as the default.

azd env new <environment> [flags]

Options

      --docs                  Opens the documentation for azd env new in your web browser.
  -h, --help                  Gets help for new.
  -l, --location string       Azure location for the new environment
      --subscription string   Name or ID of an Azure subscription to use for the new environment

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env refresh

Refresh environment settings by using information from a previous infrastructure provision.

azd env refresh <environment> [flags]

Options

      --docs                 Opens the documentation for azd env refresh in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for refresh.
      --hint string          Hint to help identify the environment to refresh

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env select

Set the default environment.

azd env select <environment> [flags]

Options

      --docs   Opens the documentation for azd env select in your web browser.
  -h, --help   Gets help for select.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env set

Manage your environment settings.

azd env set <key> <value> [flags]

Options

      --docs                 Opens the documentation for azd env set in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for set.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd hooks

Develop, test and run hooks for an application. (Beta)

Options

      --docs   Opens the documentation for azd hooks in your web browser.
  -h, --help   Gets help for hooks.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd hooks run

Runs the specified hook for the project and services

azd hooks run <name> [flags]

Options

      --docs                 Opens the documentation for azd hooks run in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for run.
      --platform string      Forces hooks to run for the specified platform.
      --service string       Only runs hooks for the specified service.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd init

Initialize a new application.

azd init [flags]

Options

  -b, --branch string         The template branch to initialize from. Must be used with a template argument (--template or -t).
      --docs                  Opens the documentation for azd init in your web browser.
  -e, --environment string    The name of the environment to use.
  -h, --help                  Gets help for init.
  -l, --location string       Azure location for the new environment
  -s, --subscription string   Name or ID of an Azure subscription to use for the new environment
  -t, --template string       The template to use when you initialize the project. You can use Full URI, <owner>/<repository>, or <repository> if it's part of the azure-samples organization.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd monitor

Monitor a deployed application. (Beta)

azd monitor [flags]

Options

      --docs                 Opens the documentation for azd monitor in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for monitor.
      --live                 Open a browser to Application Insights Live Metrics. Live Metrics is currently not supported for Python apps.
      --logs                 Open a browser to Application Insights Logs.
      --overview             Open a browser to Application Insights Overview Dashboard.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd package

Packages the application's code to be deployed to Azure. (Beta)

azd package <service> [flags]

Options

      --all                  Packages all services that are listed in azure.yaml
      --docs                 Opens the documentation for azd package in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for package.
      --output-path string   File or folder path where the generated packages will be saved.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd pipeline

Manage and configure your deployment pipelines. (Beta)

Options

      --docs   Opens the documentation for azd pipeline in your web browser.
  -h, --help   Gets help for pipeline.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd pipeline config

Configure your deployment pipeline to connect securely to Azure. (Beta)

azd pipeline config [flags]

Options

      --auth-type string             The authentication type used between the pipeline provider and Azure for deployment (Only valid for GitHub provider). Valid values: federated, client-credentials.
      --docs                         Opens the documentation for azd pipeline config in your web browser.
  -e, --environment string           The name of the environment to use.
  -h, --help                         Gets help for config.
      --principal-id string          The client id of the service principal to use to grant access to Azure resources as part of the pipeline.
      --principal-name string        The name of the service principal to use to grant access to Azure resources as part of the pipeline.
      --principal-role stringArray   The roles to assign to the service principal. By default the service principal will be granted the Contributor and User Access Administrator roles. (default [Contributor,User Access Administrator])
      --provider string              The pipeline provider to use (github for Github Actions and azdo for Azure Pipelines).
      --remote-name string           The name of the git remote to configure the pipeline to run on. (default "origin")

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd provision

Provision the Azure resources for an application.

azd provision [flags]

Options

      --docs                 Opens the documentation for azd provision in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for provision.
      --no-state             Do not use latest Deployment State (bicep only).
      --preview              Preview changes to Azure resources.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd restore

Restores the application's dependencies. (Beta)

azd restore <service> [flags]

Options

      --all                  Restores all services that are listed in azure.yaml
      --docs                 Opens the documentation for azd restore in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for restore.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd show

Display information about your app and its resources.

azd show [flags]

Options

      --docs                 Opens the documentation for azd show in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for show.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template

Find and view template details. (Beta)

Options

      --docs   Opens the documentation for azd template in your web browser.
  -h, --help   Gets help for template.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template list

Show list of sample azd templates. (Beta)

azd template list [flags]

Options

      --docs            Opens the documentation for azd template list in your web browser.
  -h, --help            Gets help for list.
  -s, --source string   Filters templates by source.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template show

Show details for a given template. (Beta)

azd template show <template> [flags]

Options

      --docs   Opens the documentation for azd template show in your web browser.
  -h, --help   Gets help for show.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template source

View and manage template sources. (Beta)

Options

      --docs   Opens the documentation for azd template source in your web browser.
  -h, --help   Gets help for source.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template source add

Adds an azd template source at the specified key (Beta)

azd template source add <key> [flags]

Options

      --docs              Opens the documentation for azd template source add in your web browser.
  -h, --help              Gets help for add.
  -l, --location string   Location of the template source.
  -n, --name string       Display name of the template source.
  -t, --type string       Kind of the template source.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template source list

Lists the configured azd template sources. (Beta)

azd template source list [flags]

Options

      --docs   Opens the documentation for azd template source list in your web browser.
  -h, --help   Gets help for list.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template source remove

Removes the specified azd template source (Beta)

azd template source remove <key> [flags]

Options

      --docs   Opens the documentation for azd template source remove in your web browser.
  -h, --help   Gets help for remove.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd up

Provision Azure resources, and deploy your project with a single command.

azd up [flags]

Options

      --docs                 Opens the documentation for azd up in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for up.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd version

Print the version number of Azure Developer CLI.

azd version [flags]

Options

      --docs   Opens the documentation for azd version in your web browser.
  -h, --help   Gets help for version.

Options inherited from parent commands

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

@vhvb1989 vhvb1989 merged commit ca4231f into Azure:main Feb 8, 2024
35 checks passed
@vhvb1989 vhvb1989 deleted the pipeline-additional-vars-secrs branch February 8, 2024 03:03
weikanglim added a commit that referenced this pull request Sep 25, 2024
Remove in-memory `main.parameters.json` cache.

By removing this in-memory cache, we incur an extra load from disk, but without any noticeable behavioral changes.

Background: In-memory caching for `main.parameters.json` was added initially to avoid a re-prompt when the user declines the prompt "Save the value in the environment for future use?" (#3155). This was added as a way to communicate within `azd` that "this value is configured for the current azd process lifetime". This was superseded by the changes in #3479 where we always saved the values to `config.json` and removed the prompt. 

Fixes #3973, #4310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Add ability to export environment variables to GitHub Actions
5 participants