title | description | author | ms.author | ms.date | ms.service | ms.topic | ms.custom |
---|---|---|---|---|---|---|---|
Azure Developer CLI reference |
This article explains the syntax and parameters for the various Azure Developer CLI commands. |
alexwolfmsft |
alexwolf |
04/03/2025 |
azure-dev-cli |
conceptual |
devx-track-azdevcli |
This article explains the syntax and parameters for the various Azure Developer CLI commands.
The Azure Developer CLI (azd
) is an open-source tool that helps onboard and manage your application on Azure
-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.
- azd add: Add a component to your project. (Alpha)
- 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 infra: Manage your Azure infrastructure.
- 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.
Add a component to your project. (Alpha)
azd add [flags]
--docs Opens the documentation for azd add in your web browser.
-h, --help Gets help for add.
-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.
Authenticate with Azure.
--docs Opens the documentation for azd auth in your web browser.
-h, --help Gets help for auth.
-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.
- azd auth login: Log in to Azure.
- azd auth logout: Log out of Azure.
- Back to top
Log in to Azure.
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.
To log in using a managed identity, pass --managed-identity, which will use the system assigned managed identity. To use a user assigned managed identity, pass --client-id in addition to --managed-identity with the client id of the user assigned managed identity you wish to use.
azd auth login [flags]
--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.
--managed-identity Use a managed identity to authenticate.
--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.
-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.
- azd auth: Authenticate with Azure.
- Back to top
Log out of Azure.
Log out of Azure
azd auth logout [flags]
--docs Opens the documentation for azd auth logout in your web browser.
-h, --help Gets help for logout.
-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.
- azd auth: Authenticate with Azure.
- Back to top
Manage azd configurations (ex: default Azure subscription, location).
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.
--docs Opens the documentation for azd config in your web browser.
-h, --help Gets help for config.
-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.
- azd config get: Gets a configuration.
- azd config list-alpha: Display the list of available features in alpha stage.
- azd config reset: Resets configuration to default.
- azd config set: Sets a configuration.
- azd config show: Show all the configuration values.
- azd config unset: Unsets a configuration.
- Back to top
Gets a configuration.
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]
--docs Opens the documentation for azd config get in your web browser.
-h, --help Gets help for get.
-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.
- azd config: Manage azd configurations (ex: default Azure subscription, location).
- Back to top
Display the list of available features in alpha stage.
azd config list-alpha [flags]
--docs Opens the documentation for azd config list-alpha in your web browser.
-h, --help Gets help for list-alpha.
-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.
- azd config: Manage azd configurations (ex: default Azure subscription, location).
- Back to top
Resets configuration to default.
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]
--docs Opens the documentation for azd config reset in your web browser.
-f, --force Force reset without confirmation.
-h, --help Gets help for reset.
-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.
- azd config: Manage azd configurations (ex: default Azure subscription, location).
- Back to top
Sets a configuration.
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]
azd config set defaults.subscription <yourSubscriptionID>
azd config set defaults.location eastus
--docs Opens the documentation for azd config set in your web browser.
-h, --help Gets help for set.
-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.
- azd config: Manage azd configurations (ex: default Azure subscription, location).
- Back to top
Show all the configuration values.
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]
--docs Opens the documentation for azd config show in your web browser.
-h, --help Gets help for show.
-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.
- azd config: Manage azd configurations (ex: default Azure subscription, location).
- Back to top
Unsets a configuration.
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]
azd config unset defaults.location
--docs Opens the documentation for azd config unset in your web browser.
-h, --help Gets help for unset.
-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.
- azd config: Manage azd configurations (ex: default Azure subscription, location).
- Back to top
Deploy the application's code to Azure.
azd deploy <service> [flags]
--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 packaged service located at the provided path. Supports zipped file packages (file path) or container images (image tag).
-h, --help Gets help for deploy.
-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.
Delete Azure resources for an application.
azd down [flags]
--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).
-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.
Manage environments.
--docs Opens the documentation for azd env in your web browser.
-h, --help Gets help for env.
-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.
- azd env get-value: Get specific environment value.
- azd env get-values: Get all environment values.
- azd env list: List environments.
- azd env new: Create a new environment and set it as the default.
- azd env refresh: Refresh environment settings by using information from a previous infrastructure provision.
- azd env select: Set the default environment.
- azd env set: Manage your environment settings.
- azd env set-secret: Set a
<name>
as a reference to a Key Vault secret in the environment. - Back to top
Get specific environment value.
azd env get-value <keyName> [flags]
--docs Opens the documentation for azd env get-value in your web browser.
-e, --environment string The name of the environment to use.
-h, --help Gets help for get-value.
-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.
- azd env: Manage environments.
- Back to top
Get all environment values.
azd env get-values [flags]
--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.
-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.
- azd env: Manage environments.
- Back to top
List environments.
azd env list [flags]
--docs Opens the documentation for azd env list in your web browser.
-h, --help Gets help for list.
-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.
- azd env: Manage environments.
- Back to top
Create a new environment and set it as the default.
azd env new <environment> [flags]
--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
-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.
- azd env: Manage environments.
- Back to top
Refresh environment settings by using information from a previous infrastructure provision.
azd env refresh <environment> [flags]
--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
-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.
- azd env: Manage environments.
- Back to top
Set the default environment.
azd env select <environment> [flags]
--docs Opens the documentation for azd env select in your web browser.
-h, --help Gets help for select.
-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.
- azd env: Manage environments.
- Back to top
Manage your environment settings.
azd env set <key> <value> [flags]
--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.
-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.
- azd env: Manage environments.
- Back to top
Set a <name>
as a reference to a Key Vault secret in the environment.
You can either create a new Key Vault secret or select an existing one. The provided name is the key for the .env file which holds the secret reference to the Key Vault secret.
azd env set-secret <name> [flags]
--docs Opens the documentation for azd env set-secret in your web browser.
-e, --environment string The name of the environment to use.
-h, --help Gets help for set-secret.
-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.
- azd env: Manage environments.
- Back to top
Develop, test and run hooks for an application. (Beta)
--docs Opens the documentation for azd hooks in your web browser.
-h, --help Gets help for hooks.
-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.
- azd hooks run: Runs the specified hook for the project and services
- Back to top
Runs the specified hook for the project and services
azd hooks run <name> [flags]
--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.
-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.
- azd hooks: Develop, test and run hooks for an application. (Beta)
- Back to top
Manage your Azure infrastructure.
--docs Opens the documentation for azd infra in your web browser.
-h, --help Gets help for infra.
-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.
- azd infra synth: Write IaC for your project to disk, allowing you to manage it by hand. (Alpha)
- Back to top
Write IaC for your project to disk, allowing you to manage it by hand. (Alpha)
azd infra synth [flags]
--docs Opens the documentation for azd infra synth in your web browser.
-e, --environment string The name of the environment to use.
--force Overwrite any existing files without prompting
-h, --help Gets help for synth.
-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.
- azd infra: Manage your Azure infrastructure.
- Back to top
Initialize a new application.
azd init [flags]
-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.
-f, --filter strings The tag(s) used to filter template results. Supports comma-separated values.
--from-code Initializes a new application from your existing code.
-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 Initializes a new application from a template. You can use Full URI, <owner>/<repository>, or <repository> if it's part of the azure-samples organization.
--up Provision and deploy to Azure after initializing the project from a template.
-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.
Monitor a deployed application. (Beta)
azd monitor [flags]
--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.
-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.
Packages the application's code to be deployed to Azure. (Beta)
azd package <service> [flags]
--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.
-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.
Manage and configure your deployment pipelines. (Beta)
--docs Opens the documentation for azd pipeline in your web browser.
-h, --help Gets help for pipeline.
-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.
- azd pipeline config: Configure your deployment pipeline to connect securely to Azure. (Beta)
- Back to top
Configure your deployment pipeline to connect securely to Azure. (Beta)
azd pipeline config [flags]
-m, --applicationServiceManagementReference string Service Management Reference. References application or service contact information from a Service or Asset Management database. This value must be a Universally Unique Identifier (UUID). You can set this value globally by running azd config set pipeline.config.applicationServiceManagementReference <UUID>.
--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")
-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.
- azd pipeline: Manage and configure your deployment pipelines. (Beta)
- Back to top
Provision the Azure resources for an application.
azd provision [flags]
--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.
-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.
Restores the application's dependencies. (Beta)
azd restore <service> [flags]
--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.
-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.
Display information about your app and its resources.
azd show [flags]
--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.
--show-secrets Unmask secrets in output.
-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.
Find and view template details. (Beta)
--docs Opens the documentation for azd template in your web browser.
-h, --help Gets help for template.
-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.
- azd template list: Show list of sample azd templates. (Beta)
- azd template show: Show details for a given template. (Beta)
- azd template source: View and manage template sources. (Beta)
- Back to top
Show list of sample azd templates. (Beta)
azd template list [flags]
--docs Opens the documentation for azd template list in your web browser.
-f, --filter strings The tag(s) used to filter template results. Supports comma-separated values.
-h, --help Gets help for list.
-s, --source string Filters templates by source.
-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.
- azd template: Find and view template details. (Beta)
- Back to top
Show details for a given template. (Beta)
azd template show <template> [flags]
--docs Opens the documentation for azd template show in your web browser.
-h, --help Gets help for show.
-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.
- azd template: Find and view template details. (Beta)
- Back to top
View and manage template sources. (Beta)
--docs Opens the documentation for azd template source in your web browser.
-h, --help Gets help for source.
-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.
- azd template: Find and view template details. (Beta)
- azd template source add: Adds an azd template source with the specified key. (Beta)
- azd template source list: Lists the configured azd template sources. (Beta)
- azd template source remove: Removes the specified azd template source (Beta)
- Back to top
Adds an azd template source with the specified key. (Beta)
The key can be any value that uniquely identifies the template source, with well-known values being: ・default: Default templates ・awesome-azd: Templates from https://aka.ms/awesome-azd
azd template source add <key> [flags]
--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. Required when using type flag.
-n, --name string Display name of the template source.
-t, --type string Kind of the template source. Supported types are 'file', 'url' and 'gh'.
-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.
- azd template source: View and manage template sources. (Beta)
- Back to top
Lists the configured azd template sources. (Beta)
azd template source list [flags]
--docs Opens the documentation for azd template source list in your web browser.
-h, --help Gets help for list.
-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.
- azd template source: View and manage template sources. (Beta)
- Back to top
Removes the specified azd template source (Beta)
azd template source remove <key> [flags]
--docs Opens the documentation for azd template source remove in your web browser.
-h, --help Gets help for remove.
-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.
- azd template source: View and manage template sources. (Beta)
- Back to top
Provision Azure resources, and deploy your project with a single command.
azd up [flags]
--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.
-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.
Print the version number of Azure Developer CLI.
azd version [flags]
--docs Opens the documentation for azd version in your web browser.
-h, --help Gets help for version.
-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.