Referência da Azure Developer CLI

Este artigo explica a sintaxe e os parâmetros para os vários comandos da CLI do Azure Developer.

azd

A CLI do Desenvolvedor do Azure (azd) é uma ferramenta de código aberto que ajuda a integrar e gerenciar seu aplicativo no Azure

Opções

  -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.

Confira também

  • azd auth: Autenticar com o Azure.
  • azd config: Gerenciar configurações azd (por exemplo, assinatura padrão do Azure, local).
  • azd deploy: implante o código do aplicativo no Azure.
  • azd down: exclua recursos do Azure para um aplicativo.
  • azd env: Gerenciar ambientes.
  • azd hooks: Desenvolver, testar e executar ganchos para uma aplicação. (Beta)
  • azd init: Inicialize um novo aplicativo.
  • azd monitor: Monitorar um aplicativo implantado. (Beta)
  • azd package: empacota o código do aplicativo a ser implantado no Azure. (Beta)
  • azd pipeline: gerencie e configure seus pipelines de implantação. (Beta)
  • azd provision: provisione os recursos do Azure para um aplicativo.
  • azd restore: restaura as dependências do aplicativo. (Beta)
  • azd show: exibe informações sobre seu aplicativo e seus recursos.
  • azd template: Localize e visualize os detalhes do modelo. (Beta)
  • azd up: provisione recursos do Azure e implante seu projeto com um único comando.
  • azd version: Imprima o número da versão da CLI do desenvolvedor do Azure.

azd auth

Autenticar com o Azure.

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd auth login

Fazer logon no Azure.

Sinopse

Fazer logon no Azure.

Quando executado sem argumentos, efetue login interativamente usando um navegador. Para fazer login usando um código de dispositivo, passe --use-device-code.

Para fazer logon como uma entidade de serviço, passe --client-id e --tenant-id, bem como um dos: --client-secret, --client-certificate ou --federated-credential-provider.

azd auth login [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

azd auth logout

Faça logoff do Azure.

Sinopse

Sair do Azure

azd auth logout [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd config

Gerenciar configurações azd (por exemplo, assinatura padrão do Azure, local).

Sinopse

Gerencie a configuração de usuário da CLI do Desenvolvedor do Azure, que inclui sua assinatura e local padrão do Azure.

Disponível desde azure-dev-cli_0.4.0-beta.1.

A maneira mais fácil de configurar azd pela primeira vez é executar azd inito . A assinatura e o config.json local selecionados serão armazenados no arquivo localizado no diretório config. Para configurar azd a qualquer momento depois, você usará azd config seto .

O valor padrão do diretório config é:

  • $HOME/.azd no Linux e macOS
  • %USERPROFILE%.azd no Windows

O diretório de configuração pode ser substituído especificando um caminho na variável de ambiente AZD_CONFIG_DIR.

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd config get

Obtém uma configuração.

Sinopse

Obtém uma configuração no caminho de configuração.

O valor padrão do diretório config é:

  • $HOME/.azd no Linux e macOS
  • %USERPROFILE%\.azd no Windows

O diretório de configuração pode ser substituído especificando um caminho na variável de ambiente AZD_CONFIG_DIR.

azd config get <path> [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd config list-alpha

Exiba a lista de recursos disponíveis no estágio alfa.

azd config list-alpha [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

redefinição de configuração azd

Redefine a configuração para padrão.

Sinopse

Redefine toda a configuração no caminho de configuração.

O valor padrão do diretório config é:

  • $HOME/.azd no Linux e macOS
  • %USERPROFILE%\.azd no Windows

O diretório de configuração pode ser substituído especificando um caminho na variável de ambiente AZD_CONFIG_DIR para o padrão.

azd config reset [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd config set

Define uma configuração.

Sinopse

Define uma configuração no caminho de configuração.

O valor padrão do diretório config é:

  • $HOME/.azd no Linux e macOS
  • %USERPROFILE%\.azd no Windows

O diretório de configuração pode ser substituído especificando um caminho na variável de ambiente AZD_CONFIG_DIR.

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

Exemplos

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

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd config show

Mostrar todos os valores de configuração.

Sinopse

Mostrar todos os valores de configuração no caminho de configuração.

O valor padrão do diretório config é:

  • $HOME/.azd no Linux e macOS
  • %USERPROFILE%\.azd no Windows

O diretório de configuração pode ser substituído especificando um caminho na variável de ambiente AZD_CONFIG_DIR.

azd config show [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd config unset

Desdefine uma configuração.

Sinopse

Remove uma configuração no caminho de configuração.

O valor padrão do diretório config é:

  • $HOME/.azd no Linux e macOS
  • %USERPROFILE%\.azd no Windows

O diretório de configuração pode ser substituído especificando um caminho na variável de ambiente AZD_CONFIG_DIR.

azd config unset <path> [flags]

Exemplos

azd config unset defaults.location

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd implantar

Implante o código do aplicativo no Azure.

azd deploy <service> [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

azd para baixo

Exclua recursos do Azure para um aplicativo.

azd down [flags]

Opções

      --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).

Opções herdadas de comandos pai

  -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.

Confira também

azd env

Gerenciar ambientes.

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd env get-values

Obtenha todos os valores do ambiente.

azd env get-values [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

azd env lista

Listar ambientes.

azd env list [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd env novo

Crie um novo ambiente e defina-o como padrão.

azd env new <environment> [flags]

Opções

      --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

Opções herdadas de comandos pai

  -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.

Confira também

azd env refresh

Atualize as configurações do ambiente usando informações de uma provisão de infraestrutura anterior.

azd env refresh <environment> [flags]

Opções

      --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

Opções herdadas de comandos pai

  -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.

Confira também

azd env select

Defina o ambiente padrão.

azd env select <environment> [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd env set

Gerencie as configurações do seu ambiente.

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

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

azd ganchos

Desenvolver, testar e executar ganchos para uma aplicação. (Beta)

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd ganchos executar

Executa o gancho especificado para o projeto e os serviços

azd hooks run <name> [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

azd init

Inicialize um novo aplicativo.

azd init [flags]

Opções

  -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.

Opções herdadas de comandos pai

  -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.

Confira também

Monitor AZD

Monitorar um aplicativo implantado. (Beta)

azd monitor [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

pacote azd

Empacota o código do aplicativo a ser implantado no Azure. (Beta)

azd package <service> [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

Pipeline AZD

Gerencie e configure seus pipelines de implantação. (Beta)

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd pipeline config

Configure seu pipeline de implantação para se conectar com segurança ao Azure. (Beta)

azd pipeline config [flags]

Opções

      --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")

Opções herdadas de comandos pai

  -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.

Confira também

Provisão AZD

Provisione os recursos do Azure para um aplicativo.

azd provision [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

azd restaurar

Restaura as dependências do aplicativo. (Beta)

azd restore <service> [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

AZD Show

Exiba informações sobre seu aplicativo e seus recursos.

azd show [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

azd template

Localize e exiba detalhes do modelo. (Beta)

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

Lista de modelos AZD

Mostrar lista de modelos azd de exemplo. (Beta)

azd template list [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

azd template show

Mostrar detalhes de um determinado modelo. (Beta)

azd template show <template> [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

Fonte do modelo AZD

Exibir e gerenciar fontes de modelo. (Beta)

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd template source add

Adiciona uma fonte de modelo azd na chave especificada (Beta)

azd template source add <key> [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

Lista de fontes do modelo AZD

Lista as fontes de modelo azd configuradas. (Beta)

azd template source list [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

Remoção da fonte do modelo azd

Remove a origem do modelo azd especificado (Beta)

azd template source remove <key> [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também

azd up

Provisione recursos do Azure e implante seu projeto com um único comando.

azd up [flags]

Opções

      --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.

Opções herdadas de comandos pai

  -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.

Confira também

versão azd

Imprima o número da versão da CLI do Desenvolvedor do Azure.

azd version [flags]

Opções

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

Opções herdadas de comandos pai

  -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.

Confira também