Referens för Azure Developer CLI

I den här artikeln beskrivs syntaxen och parametrarna för de olika Azure Developer CLI-kommandona.

azd

Azure Developer CLI (azd) är ett verktyg med öppen källkod som hjälper dig att registrera och hantera ditt program i Azure

Alternativ

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

Se även

  • azd auth: Autentisera med Azure.
  • azd config: Hantera azd-konfigurationer (till exempel azure-standardprenumeration, plats).
  • azd deploy: Distribuera programmets kod till Azure.
  • azd down: Ta bort Azure-resurser för ett program.
  • azd env: Hantera miljöer.
  • azd hooks: Utveckla, testa och köra krokar för ett program. (Beta)
  • azd init: Initiera ett nytt program.
  • azd monitor: Övervaka ett distribuerat program. (Beta)
  • azd-paket: Paketera programmets kod som ska distribueras till Azure. (Beta)
  • azd pipeline: Hantera och konfigurera dina distributionspipelines. (Beta)
  • azd provision: Etablera Azure-resurserna för ett program.
  • azd restore: Återställer programmets beroenden. (Beta)
  • azd show: Visa information om din app och dess resurser.
  • azd template: Hitta och visa mallinformation. (Beta)
  • azd up: Etablera Azure-resurser och distribuera projektet med ett enda kommando.
  • azd version: Skriv ut versionsnumret för Azure Developer CLI.

azd auth

Autentisera med Azure.

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd auth login

Logga in på Azure.

Sammanfattning

Logga in på Azure.

När du kör utan argument loggar du in interaktivt med hjälp av en webbläsare. Om du vill logga in med en enhetskod skickar du --use-device-code.

Om du vill logga in som tjänstens huvudnamn skickar du --client-id och --tenant-id samt ett av: --client-secret, --client-certificate eller --federated-credential-provider.

azd auth login [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd auth-utloggning

Logga ut från Azure.

Sammanfattning

Logga ut från Azure

azd auth logout [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd config

Hantera azd-konfigurationer (till exempel azure-standardprenumeration, plats).

Sammanfattning

Hantera Azure Developer CLI-användarkonfigurationen, som innehåller din standardprenumeration och plats för Azure.

Tillgänglig sedan azure-dev-cli_0.4.0-beta.1.

Det enklaste sättet att konfigurera azd för första gången är att köra azd init. Den prenumeration och plats som du väljer lagras i config.json filen som finns i konfigurationskatalogen. Om du vill konfigurera azd när som helst efteråt använder azd config setdu .

Standardvärdet för konfigurationskatalogen är:

  • $HOME/.azd på Linux och macOS
  • %USERPROFILE%.azd på Windows

Konfigurationskatalogen kan åsidosättas genom att ange en sökväg i AZD_CONFIG_DIR miljövariabeln.

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd config get

Hämtar en konfiguration.

Sammanfattning

Hämtar en konfiguration i konfigurationssökvägen.

Standardvärdet för konfigurationskatalogen är:

  • $HOME/.azd på Linux och macOS
  • %USERPROFILE%\.azd i Windows

Konfigurationskatalogen kan åsidosättas genom att ange en sökväg i AZD_CONFIG_DIR miljövariabeln.

azd config get <path> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd config list-alpha

Visa listan över tillgängliga funktioner i alfasteget.

azd config list-alpha [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd config reset

Återställer konfigurationen till standard.

Sammanfattning

Återställer all konfiguration i konfigurationssökvägen.

Standardvärdet för konfigurationskatalogen är:

  • $HOME/.azd på Linux och macOS
  • %USERPROFILE%\.azd i Windows

Konfigurationskatalogen kan åsidosättas genom att ange en sökväg i AZD_CONFIG_DIR miljövariabeln som standard.

azd config reset [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd config set

Anger en konfiguration.

Sammanfattning

Anger en konfiguration i konfigurationssökvägen.

Standardvärdet för konfigurationskatalogen är:

  • $HOME/.azd på Linux och macOS
  • %USERPROFILE%\.azd i Windows

Konfigurationskatalogen kan åsidosättas genom att ange en sökväg i AZD_CONFIG_DIR miljövariabeln.

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

Exempel

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

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd config show

Visa alla konfigurationsvärden.

Sammanfattning

Visa alla konfigurationsvärden i konfigurationssökvägen.

Standardvärdet för konfigurationskatalogen är:

  • $HOME/.azd på Linux och macOS
  • %USERPROFILE%\.azd i Windows

Konfigurationskatalogen kan åsidosättas genom att ange en sökväg i AZD_CONFIG_DIR miljövariabeln.

azd config show [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd config unset

Tar bort en konfiguration.

Sammanfattning

Tar bort en konfiguration i konfigurationssökvägen.

Standardvärdet för konfigurationskatalogen är:

  • $HOME/.azd på Linux och macOS
  • %USERPROFILE%\.azd i Windows

Konfigurationskatalogen kan åsidosättas genom att ange en sökväg i AZD_CONFIG_DIR miljövariabeln.

azd config unset <path> [flags]

Exempel

azd config unset defaults.location

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd deploy

Distribuera programmets kod till Azure.

azd deploy <service> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd down

Ta bort Azure-resurser för ett program.

azd down [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd env

Hantera miljöer.

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd env get-values

Hämta alla miljövärden.

azd env get-values [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd env list

Lista miljöer.

azd env list [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd env new

Skapa en ny miljö och ange den som standard.

azd env new <environment> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd env refresh

Uppdatera miljöinställningarna med hjälp av information från en tidigare infrastrukturetablering.

azd env refresh <environment> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd env select

Ange standardmiljön.

azd env select <environment> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd env set

Hantera dina miljöinställningar.

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

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd hooks

Utveckla, testa och köra krokar för ett program. (Beta)

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd hooks run

Kör den angivna kroken för projektet och tjänsterna

azd hooks run <name> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd init

Initiera ett nytt program.

azd init [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd monitor

Övervaka ett distribuerat program. (Beta)

azd monitor [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd-paket

Paketeras programmets kod som ska distribueras till Azure. (Beta)

azd package <service> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd pipeline

Hantera och konfigurera dina distributionspipelines. (Beta)

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd pipeline config

Konfigurera distributionspipelinen så att den ansluter säkert till Azure. (Beta)

azd pipeline config [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd provision

Etablera Azure-resurserna för ett program.

azd provision [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd restore

Återställer programmets beroenden. (Beta)

azd restore <service> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd show

Visa information om din app och dess resurser.

azd show [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd-mall

Hitta och visa mallinformation. (Beta)

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd template list

Visa en lista över azd-exempelmallar. (Beta)

azd template list [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd template show

Visa information för en viss mall. (Beta)

azd template show <template> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd template source

Visa och hantera mallkällor. (Beta)

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd template source add

Lägger till en azd-mallkälla vid den angivna nyckeln (Beta)

azd template source add <key> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd template source list

Visar en lista över de konfigurerade azd-mallkällorna. (Beta)

azd template source list [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd template source remove

Tar bort den angivna azd-mallkällan (Beta)

azd template source remove <key> [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd up

Etablera Azure-resurser och distribuera projektet med ett enda kommando.

azd up [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även

azd version

Skriv ut versionsnumret för Azure Developer CLI.

azd version [flags]

Alternativ

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

Alternativ som ärvs från överordnade kommandon

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

Se även