共用方式為


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:將元件新增至您的專案。
  • azd auth:向 Azure 進行驗證。
  • azd 補全:生成 shell 補完指令碼。
  • azd config:管理 azd configurations (例如:預設 Azure 訂用帳戶,位置)。
  • azd deploy:將您的專案程序代碼部署至 Azure。
  • azd down:刪除專案的 Azure 資源。
  • azd env:管理環境(例如:默認環境、環境變數)。
  • azd 擴充功能:管理 azd 擴充功能。
  • azd hooks:開發、測試及執行專案的鉤子。
  • azd infra:管理基礎架構即程式碼 (IaC)。
  • azd init:初始化新的應用程式。
  • azd mcp:管理模型內容通訊協定 (MCP) 伺服器。 (阿爾法)
  • 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 新增

將元件新增至您的專案。

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 之外,還傳遞 --managed-identity,以及您想要使用之使用者指派受控識別的用戶端標識符。

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 auth 登出

登出 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 完成腳本。

完成命令允許您為您的 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 自動補全 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完成魚

產生魚完成腳本。

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

管理 azd configurations (例如:預設 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 取得

取得組態。

概要

取得組態路徑中的組態。

群組態目錄的預設值為:

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

您可以在 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 設定重置

將組態重設為預設值。

概要

重設組態路徑中的所有組態。

群組態目錄的預設值為:

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

您可以藉由將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 配置設定

設定組態。

概要

設定組態路徑中的組態。

群組態目錄的預設值為:

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

您可以在 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 配置

顯示所有組態值。

概要

顯示組態路徑中的所有組態值。

群組態目錄的預設值為:

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

您可以在 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

取消設定。

概要

拿掉組態路徑中的組態。

群組態目錄的預設值為:

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

您可以在 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 部署

將您的項目程式代碼部署至 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 get-values (取得變數值)

取得所有環境值。

azd env get-values [flags]

選項

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

繼承自父命令的選項

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

另請參閱

azd 環境清單

列出環境。

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 環境刷新命令

使用先前基礎結構佈建的資訊來重新整理環境值。

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 文件載入,設定一或多個環境值。

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

將名稱設定為環境中 Key Vault 秘密的參考。

概要

您可以建立新的金鑰保存庫密碼,或選取現有的密碼。 提供的名稱是 .env 檔案的關鍵字,其中包含對 Key Vault 的秘密參考。

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 擴充功能

管理 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 擴充功能清單

列出可用的擴充功能。

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 延伸模組來源移除

移除具有指定名稱的延伸模組來源

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 延伸模組解除安裝

解除安裝指定的延伸模組。

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 延伸模組升級

升級指定的延伸模組。

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 掛鉤函數

開發、測試及執行專案的勾點。

選項

      --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 掛鉤運行

執行項目和服務指定的勾點

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 基礎設施

管理基礎架構即程式碼 (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 生成

將專案的 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 init

初始化新的應用程式。

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) 伺服器。 (阿爾法)

選項

      --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 --global --permission always

Grant project permission to a specific tool with read-only scope:
  
```azdeveloper
azd mcp consent grant --server my-server --tool my-tool --permission project --scope read-only

```azdeveloper
azd mcp consent grant [flags]

選項

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

啟動 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 管道配置

將您的部署管線設定為安全地連線到 Azure。 (搶鮮版 (Beta))

azd pipeline config [flags]

選項

  -m, --applicationServiceManagementReference string   Service Management Reference. References application or service contact information from a Service or Asset Management database. This value must be a Universally Unique Identifier (UUID). You can set this value globally by running azd config set pipeline.config.applicationServiceManagementReference <UUID>.
      --auth-type string                               The authentication type used between the pipeline provider and Azure for deployment (Only valid for GitHub provider). Valid values: federated, client-credentials.
      --docs                                           Opens the documentation for azd pipeline config in your web browser.
  -e, --environment string                             The name of the environment to use.
  -h, --help                                           Gets help for config.
      --principal-id string                            The client id of the service principal to use to grant access to Azure resources as part of the pipeline.
      --principal-name string                          The name of the service principal to use to grant access to Azure resources as part of the pipeline.
      --principal-role stringArray                     The roles to assign to the service principal. By default the service principal will be granted the Contributor and User Access Administrator roles. (default [Contributor,User Access Administrator])
      --provider string                                The pipeline provider to use (github for Github Actions and azdo for Azure Pipelines).
      --remote-name string                             The name of the git remote to configure the pipeline to run on. (default "origin")

繼承自父命令的選項

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

另請參閱

azd 配置

為您的專案布建 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 發佈

將服務發佈至容器登錄。

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

恢復專案的依賴項。

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秀

顯示專案及其資源的相關信息。

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 templates 的清單。 (搶鮮版 (Beta))

azd template list [flags]

選項

      --docs             Opens the documentation for azd template list in your web browser.
  -f, --filter strings   The tag(s) used to filter template results. Supports comma-separated values.
  -h, --help             Gets help for list.
  -s, --source string    Filters templates by source.

繼承自父命令的選項

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

另請參閱

azd 模板顯示

顯示指定範本的詳細數據。 (搶鮮版 (Beta))

azd template show <template> [flags]

選項

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

繼承自父命令的選項

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

另請參閱

azd範本來源

檢視和管理範本來源。 (搶鮮版 (Beta))

選項

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

繼承自父命令的選項

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

另請參閱

azd 樣板源添加

使用指定的索引鍵新增 azd 範本來源。 (搶鮮版 (Beta))

概要

索引鍵可以是可唯一識別範本來源的任何值,已知值如下:•預設值:預設範本 •awesome-azd:來自的範本 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 範本來源。 (搶鮮版 (Beta))

azd template source list [flags]

選項

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

繼承自父命令的選項

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

另請參閱

移除 azd 範本來源

移除指定的 azd 樣本來源 (Beta)

azd template source remove <key> [flags]

選項

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

繼承自父命令的選項

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

另請參閱

azd up (啟動 azd)

使用單一命令將專案布建和部署至 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.

另請參閱