Azure Developer CLI 参考

本文介绍了各种 Azure 开发人员 CLI 命令的语法和参数。

azd

Azure 开发人员 CLI (azd) 是一种开源工具,可帮助在 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.
  • azd auth:使用 Azure 进行身份验证。
  • azd completion:生成 shell 完成脚本。
  • azd config:管理 azd 配置(示例:默认 Azure 订阅、位置)。
  • azd deploy:将项目代码部署到 Azure。
  • azd down:删除项目的 Azure 资源。
  • azd env:管理环境(例如:默认环境,环境变量)。
  • azd extension:管理 azd 扩展功能。
  • azd hooks:开发、测试和运行项目钩子。
  • azd infra:管理基础结构即代码 (IaC)。
  • azd init:初始化新应用程序。
  • azd mcp:管理模型上下文协议 (MCP) 服务器。 (Alpha)
  • azd monitor:监视已部署的项目。
  • azd package:打包要部署到 Azure 的项目代码。
  • azd pipeline:管理和配置部署管道。
  • azd provision:为项目预配 Azure 资源。
  • azd publish:将服务发布到容器注册表。
  • azd restore:还原项目的依赖项。
  • azd show:显示有关项目及其资源的信息。
  • azd template:查找和查看模板详细信息。
  • azd up:使用单个命令预配项目并将其部署到 Azure。
  • azd version:打印 Azure 开发人员 CLI 的版本号。

azd add (添加)

将组件添加到项目。

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.

另请参阅

azd 认证

使用 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 身份验证登录

登录到 Azure。

摘要

登录到 Azure。

在不使用任何参数的情况下运行时,使用浏览器以交互方式登录。 若要使用设备代码登录,请传递 --use-device-code。

若要以服务主体身份登录,请传递 --client-id 和 --tenant-id 以及以下一项:--client-secret、--client-certificate 或 --federated-credential-provider。

若要使用托管标识登录,请传递 --managed-identity,这将使用系统分配的托管标识。 若要使用用户分配的托管标识,则除了 --managed-identity 外,还请传递 --client-id,以及要使用的用户分配的托管标识的客户端 ID。

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. Supported values: github, azure-pipelines, oidc
  -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 认证 退出

从 Azure 注销。

摘要

从 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 补全

生成 shell 完成脚本。

摘要

为 azd 生成命令行补全脚本。

完成命令允许你为 shell 生成自动完成脚本,目前支持 bash、zsh、fish 和 PowerShell。

有关如何使用生成的脚本的详细信息,请参阅每个子命令的帮助。

选项

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

从父命令继承的选项

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

生成 bash 完成脚本。

azd completion bash

选项

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

从父命令继承的选项

  -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 完成 fish(命令行自动补全)

生成鱼完成脚本。

azd completion fish

选项

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

从父命令继承的选项

  -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 自动补全 powershell

生成 PowerShell 完成脚本。

azd completion powershell

选项

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

从父命令继承的选项

  -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 自动完成设置在 zsh 中

生成 zsh 完成脚本。

azd completion zsh

选项

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

从父命令继承的选项

  -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

管理 azd 配置(示例:默认 Azure 订阅、位置)。

摘要

管理 Azure 开发人员 CLI 用户配置,其中包括默认 Azure 订阅和位置。

azure-dev-cli_0.4.0-beta.1 起可用。

首次配置 azd 的最简单方法是运行 azd init。 选择的订阅和位置将存储在位于配置目录的 config.json 文件中。 若要以后随时配置 azd,将使用 azd config set

配置目录的默认值为:

  • Linux 和 macOS 上的 $HOME/.azd
  • Windows 上的 %USERPROFILE%.azd

可以通过在 AZD_CONFIG_DIR 环境变量中指定路径来重写配置目录。

选项

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

获取配置。

摘要

获取配置路径中的配置。

配置目录的默认值为:

  • Linux 和 macOS 上的 $HOME/.azd
  • 在 Windows 上为 %USERPROFILE%\.azd

可以通过在 AZD_CONFIG_DIR 环境变量中指定路径来重写配置目录。

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 list-alpha(列出 alpha 配置)

显示 alpha 阶段中可用功能的列表。

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 reset(重置配置)

将配置重置为默认值。

摘要

重置配置路径中的所有配置。

配置目录的默认值为:

  • Linux 和 macOS 上的 $HOME/.azd
  • 在 Windows 上为 %USERPROFILE%\.azd

可以通过将 AZD_CONFIG_DIR 环境变量中的路径指定为默认值来重写配置目录。

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 set

设置配置。

摘要

设置配置路径中的配置。

配置目录的默认值为:

  • Linux 和 macOS 上的 $HOME/.azd
  • 在 Windows 上为 %USERPROFILE%\.azd

可以通过在 AZD_CONFIG_DIR 环境变量中指定路径来重写配置目录。

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 show` 显示配置

显示所有配置值。

摘要

显示配置路径中的所有配置值。

配置目录的默认值为:

  • Linux 和 macOS 上的 $HOME/.azd
  • 在 Windows 上为 %USERPROFILE%\.azd

可以通过在 AZD_CONFIG_DIR 环境变量中指定路径来重写配置目录。

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 unset (取消配置命令)

取消设置配置。

摘要

删除配置路径中的配置。

配置目录的默认值为:

  • Linux 和 macOS 上的 $HOME/.azd
  • 在 Windows 上为 %USERPROFILE%\.azd

可以通过在 AZD_CONFIG_DIR 环境变量中指定路径来重写配置目录。

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 deploy

将项目代码部署到 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.

另请参阅

azd 停止

删除项目的 Azure 资源。

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.

另请参阅

azd env

管理环境(例如默认环境、环境变量)。

选项

      --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(获取环境变量的值)

获取特定环境值。

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 获取值

获取所有环境值。

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 list

列出环境。

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 new

创建新环境并将其设置为默认值。

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 refresh

使用先前基础结构预配中的信息刷新环境值。

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 select # 命令用于选择环境

设置默认环境。

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 set

设置一个或多个环境值。

摘要

使用键值对或通过从 .env 格式化文件加载来设置一个或多个环境值。

azd env set [<key> <value>] | [<key>=<value> ...] | [--file <filepath>] [flags]

选项

      --docs                 Opens the documentation for azd env set in your web browser.
  -e, --environment string   The name of the environment to use.
      --file string          Path to .env formatted file to load environment values from.
  -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 设置密钥

将名称设置为对环境中的 Key Vault 机密的引用。

摘要

可以创建新的 Key Vault 机密,也可以选择现有密钥。 提供的名称是 .env 文件的密钥,该文件保存对密钥保管库机密的机密引用。

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 extension

管理 azd 扩展。

选项

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

从父命令继承的选项

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

安装指定的扩展。

azd extension install <extension-name> [flags]

选项

      --docs             Opens the documentation for azd extension install in your web browser.
  -f, --force            Force installation even if it would downgrade the current version
  -h, --help             Gets help for install.
  -s, --source string    The extension source to use for installs
  -v, --version string   The version of the extension to install

从父命令继承的选项

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

列出可用的扩展。

azd extension list [--installed] [flags]

选项

      --docs            Opens the documentation for azd extension list in your web browser.
  -h, --help            Gets help for list.
      --installed       List installed extensions
      --source string   Filter extensions by source
      --tags strings    Filter extensions by tags

从父命令继承的选项

  -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 扩展 显示

显示特定扩展的详细信息。

azd extension show <extension-name> [flags]

选项

      --docs            Opens the documentation for azd extension show in your web browser.
  -h, --help            Gets help for show.
  -s, --source string   The extension source to use.

从父命令继承的选项

  -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扩展源

查看和管理扩展源

选项

      --docs   Opens the documentation for azd extension 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 扩展源

添加具有指定名称的扩展源

azd extension source add [flags]

选项

      --docs              Opens the documentation for azd extension source add in your web browser.
  -h, --help              Gets help for add.
  -l, --location string   The location of the extension source
  -n, --name string       The name of the extension source
  -t, --type string       The type of the extension source. Supported types are 'file' and 'url'

从父命令继承的选项

  -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 扩展源列表

列出扩展源

azd extension source list [flags]

选项

      --docs   Opens the documentation for azd extension 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 extension source remove(删除扩展源命令)

删除具有指定名称的扩展源

azd extension source remove <name> [flags]

选项

      --docs   Opens the documentation for azd extension 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 extension uninstall

卸载指定的扩展。

azd extension uninstall <extension-name> [flags]

选项

      --all    Uninstall all installed extensions
      --docs   Opens the documentation for azd extension uninstall in your web browser.
  -h, --help   Gets help for uninstall.

从父命令继承的选项

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

升级指定的扩展。

azd extension upgrade <extension-name> [flags]

选项

      --all              Upgrade all installed extensions
      --docs             Opens the documentation for azd extension upgrade in your web browser.
  -h, --help             Gets help for upgrade.
  -s, --source string    The extension source to use for upgrades
  -v, --version string   The version of the extension to upgrade to

从父命令继承的选项

  -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

为项目开发、测试和运行钩子。

选项

      --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(执行钩子命令)

为项目和服务运行指定的挂钩

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 infra

管理基础结构即代码 (IaC)。

选项

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

将项目的 IaC 写入磁盘,允许你手动管理它。

azd infra generate [flags]

选项

      --docs                 Opens the documentation for azd infra generate 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 generate.

从父命令继承的选项

  -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 初始化

初始化新应用程序。

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
  -m, --minimal               Initializes a minimal project.
  -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.

另请参阅

azd mcp

管理模型上下文协议 (MCP) 服务器。 (Alpha)

选项

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

从父命令继承的选项

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

另请参阅

管理 MCP 工具许可。

摘要

管理 MCP 工具执行的同意规则。

选项

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

从父命令继承的选项

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

另请参阅

授予许可信任规则

摘要

为 MCP 工具和服务器授予信任规则。

此命令创建许可规则,允许 MCP 工具在不提示权限的情况下执行。 可以为规则指定不同的权限级别和范围。

azd mcp consent grant [flags]

示例:

全局始终授予对所有工具的权限。

azd mcp consent grant --global --permission always

向具有只读作用域的特定工具授予项目权限:

azd mcp consent grant --server my-server --tool my-tool --permission project --scope read-only

选项

      --action string       Action type: 'all' or 'readonly' (default "all")
      --docs                Opens the documentation for azd mcp consent grant in your web browser.
      --global              Apply globally to all servers
  -h, --help                Gets help for grant.
      --operation string    Operation type: 'tool' or 'sampling' (default "tool")
      --permission string   Permission: 'allow', 'deny', or 'prompt' (default "allow")
      --scope string        Rule scope: 'global', or 'project' (default "global")
      --server string       Server name
      --tool string         Specific tool name (requires --server)

从父命令继承的选项

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

另请参阅

列出同意规则。

摘要

列出 MCP 工具的所有同意规则。

azd mcp consent list [flags]

选项

      --action string       Action type to filter by (readonly, any)
      --docs                Opens the documentation for azd mcp consent list in your web browser.
  -h, --help                Gets help for list.
      --operation string    Operation to filter by (tool, sampling)
      --permission string   Permission to filter by (allow, deny, prompt)
      --scope string        Consent scope to filter by (global, project). If not specified, lists rules from all scopes.
      --target string       Specific target to operate on (server/tool format)

从父命令继承的选项

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

另请参阅

撤销许可规则。

摘要

撤销 MCP 工具的许可规则。

azd mcp consent revoke [flags]

选项

      --action string       Action type to filter by (readonly, any)
      --docs                Opens the documentation for azd mcp consent revoke in your web browser.
  -h, --help                Gets help for revoke.
      --operation string    Operation to filter by (tool, sampling)
      --permission string   Permission to filter by (allow, deny, prompt)
      --scope string        Consent scope to filter by (global, project). If not specified, revokes rules from all scopes.
      --target string       Specific target to operate on (server/tool format)

从父命令继承的选项

  -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 mcp start(启动命令)

启动 MCP 服务器。

摘要

启动模型上下文协议 (MCP) 服务器。

此命令启动 MCP 服务器,MCP 客户端可以使用该服务器通过模型上下文协议接口访问 azd 功能。

azd mcp start [flags]

选项

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

从父命令继承的选项

  -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 监视器

监视已部署的项目。

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.

另请参阅

azd软件包

打包要部署到 Azure 的项目代码。

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.

另请参阅

azd 流水线

管理和配置部署管道。

选项

      --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 流水线 config

将部署管道配置为安全地连接到 Azure。 (测试版)

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

为项目预配 Azure 资源。

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             (Bicep only) Forces a fresh deployment based on current Bicep template files, ignoring any stored deployment state.
      --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.

另请参阅

azd publish

将服务发布到容器注册表。

azd publish <service> [flags]

选项

      --all                   Publishes all services that are listed in azure.yaml
      --docs                  Opens the documentation for azd publish in your web browser.
  -e, --environment string    The name of the environment to use.
      --from-package string   Publishes the service from a container image (image tag).
  -h, --help                  Gets help for publish.
      --to string             The target container image in the form '[registry/]repository[:tag]' to publish to.

从父命令继承的选项

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

恢复项目的依赖项。

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.

另请参阅

azd show

显示有关项目及其资源的信息。

azd show [resource name or ID] [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.

另请参阅

azd 模板

查找和查看模板详细信息。

选项

      --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模板列表

显示示例 azd 模板的列表。 (测试版)

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 show(显示模板)

显示给定模板的详细信息。 (测试版)

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 模板源

查看和管理模板源。 (测试版)

选项

      --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 模板源添加

添加具有指定键的 azd 模板源。 (测试版)

摘要

该键可以是唯一标识模板源的任何值,已知值为: ・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 模板来源列表

列出配置的 azd 模板源。 (测试版)

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 模板源移除

删除指定的 azd 模板源(测试版)

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 up

使用单个命令将项目预配并部署到 Azure。

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.

另请参阅

azd版本信息

打印 Azure 开发人员 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.

另请参阅