Azure Developer CLI 參考資料

本文說明各種 Azure 開發者 CLI 指令的語法與參數。

azd

Azure Developer 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.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for azd.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

  • azd add:將元件新增至您的專案。
  • azd auth:用 Azure 認證。
  • azd 補全:生成 shell 補完指令碼。
  • azd config: 管理azd配置(例如:預設Azure訂閱、位置)。
  • azd copilot:管理 GitHub Copilot Agent設定。 (預覽)
  • azd deploy:將專案程式碼部署到 Azure。
  • azd down:刪除你專案的Azure資源。
  • azd env:管理環境(例如:默認環境、環境變數)。
  • azd exec:執行帶有 azd 環境上下文的指令與腳本。
  • 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 tool: Manage Azure development tools.
  • azd up:用一個指令配置並部署你的專案到 Azure。
  • azd 更新:azd 已更新至最新版本。
  • azd 版本:列印 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

進行 azd 認證登錄

登入 Azure。

概要

登入 Azure。

在沒有任何自變數的情況下執行時,請使用瀏覽器以互動方式登入。 若要使用裝置程式代碼登入,請傳遞 --use-device-code。

若要以服務主體身分登入,請傳遞 --client-id 和 --tenant-id,以及下列其中一個:--client-secret、--client-certificate 或 --federated-credential-provider。

若要使用受控識別登入,請傳遞 --managed-identity,這會使用系統指派的受控識別。 若要使用使用者指派的受控識別,除了使用 --managed-identity 之外,還需傳遞 --client-id 並指定您想要使用之使用者指派受控識別的用戶端標識符。

當已登入時,azd 會自動清除快取的認證資料(例如過期的憑證),然後再重新驗證。 這確保了登入狀態乾淨,並防止快取憑證過期或損壞的問題。

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD 認證狀態

顯示目前的認證狀態。

概要

請顯示您是否已登入 Azure 以及相關的帳號資訊。

azd auth status [flags]

選項

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

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 完成圖

產生Fig自動完成規格。

azd completion fig

選項

      --docs                       Opens the documentation for azd completion fig in your web browser.
  -h, --help                       Gets help for fig.
      --include-help-subcommands   Include subcommands under the help command in the Fig spec

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd配置

管理 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
  • %USERPROFILE%.azd 在Windows

您可以在 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 配置選項

列出所有可用的設定。

概要

列出所有可用azd設定的設定,包括描述與允許的值。

azd config options [flags]

選項

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

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

顯示 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd config sub-filter

管理租戶範圍訂閱提示的訂閱篩選器。

概要

管理每個租戶訂閱的篩選器,控制互動提示中顯示哪些訂閱。 過濾器會儲存在你的使用者設定中,並依裝置套用。

選項

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

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd config sub-filter remove

移除租戶儲存的訂閱篩選器。

概要

移除租戶的訂閱篩選,讓所有訂閱在提示時都能顯示。

azd config sub-filter remove [flags]

選項

      --docs   Opens the documentation for azd config sub-filter 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd config sub-filter set

為租戶設定訂閱篩選器。

概要

在特定租戶下被要求訂閱時,選擇要包含哪些訂閱。 如果已有篩選器,先前選擇的訂閱會被預先檢查。

azd config sub-filter set [flags]

選項

      --docs   Opens the documentation for azd config sub-filter 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

在 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD 副駕駛

管理 GitHub Copilot Agent 設定。 (預覽)

選項

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

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

工具使用權限管理

概要

管理工具執行的同意規則。

選項

      --docs   Opens the documentation for azd copilot 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

授予同意與信任規則。

概要

設定對工具與伺服器的信任規則。

此指令建立同意規則,允許工具執行而無需提示許可。 您可以為規則指定不同的權限層級和範圍。

範例:全球所有工具始終授予權限 azd copilot consent grant --global --permission always

授予特定工具專案權限,權限為唯讀範圍 azd 副駕駛同意 --server my-server --tool my-tool --permission project --scope 只讀

azd copilot consent grant [flags]

選項

      --action string       Action type: 'all' or 'readonly' (default "all")
      --docs                Opens the documentation for azd copilot 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

列出同意聲明規則。

概要

列出所有工具的同意規則。

azd copilot consent list [flags]

選項

      --action string       Action type to filter by (all, readonly)
      --docs                Opens the documentation for azd copilot 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

撤銷同意規則。

概要

撤銷工具的授權規則。

azd copilot consent revoke [flags]

選項

      --action string       Action type to filter by (all, readonly)
      --docs                Opens the documentation for azd copilot 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
      --timeout int           Maximum time in seconds for azd to wait for each service deployment. This stops azd from waiting but does not cancel the Azure-side deployment. (default: 1200) (default 1200)

繼承自父命令的選項

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 停用

刪除你專案的 Azure 資源。

azd down [<layer>] [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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 環境設定

管理環境設定(例如:儲存在 .azure/{environment}/config.json)。

選項

      --docs   Opens the documentation for azd env 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 環境 配置 獲取

從環境中取得設定值。

概要

從環境的 config.json 檔案取得設定值。

azd env config get <path> [flags]

選項

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

繼承自父命令的選項

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd env config Set

在環境中設定設定值。

概要

在環境的 config.json 檔案中設定設定值。

值會在可能的情況下自動解析為 JSON 類型。 布林值(true/false)、數字(42、3.14)、陣列([...])和物件({...})皆以其原生 JSON 類型儲存。 純文字值以字串形式儲存。 若要強制將 JSON 型別值儲存為字串,請用 JSON 引號包裹(例如 'true' 或 '“8080”'')。

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

範例

azd env config set myapp.endpoint https://example.com
azd env config set myapp.debug true
azd env config set myapp.count 42
azd env config set infra.parameters.tags '{"env":"dev"}'
azd env config set myapp.port '"8080"'

選項

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

繼承自父命令的選項

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 環境配置未設置

在環境中取消設置值。

概要

移除環境 config.json 檔案中的設定值。

azd env config unset <path> [flags]

範例

azd env config unset myapp.endpoint

選項

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

繼承自父命令的選項

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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   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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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
      --layer string         Provisioning layer to refresh the environment from.

繼承自父命令的選項

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD ENV 移除

移除一個環境。

azd env remove <environment> [flags]

選項

      --docs                 Opens the documentation for azd env remove in your web browser.
  -e, --environment string   The name of the environment to use.
      --force                Skips confirmation before performing removal.
  -h, --help                 Gets help for remove.

繼承自父命令的選項

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

設置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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

設置環境密碼的命令 azd env set-secret

設定一個名稱作為環境中 金鑰保存庫 秘密的參考。

概要

你可以建立新的 金鑰保存庫 秘密,或選擇現有的秘密。 所提供的名稱是 .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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD執行委員會

執行帶有azd環境上下文的指令和腳本。

概要

執行指令和腳本時,可以完全存取 azd 環境變數。

指令執行時,azd 環境已載入子程序中。 多參數使用直接程序執行(無 shell 包裝)。 以單引號括住的引數會使用 shell 內嵌執行。

範例:azd exec python script.py # 直接執行(精確 argv) azd exec npm run dev # 直接執行(無 shell) azd exec -- python app.py --port 8000 # 直接執行並帶有旗標 azd exec 'echo $AZURE_ENV_NAME' # 透過 shell 內嵌執行 azd exec ./setup.sh # 執行腳本檔案 azd exec --shell pwsh "Write-Host 'Hello'" # 內嵌 PowerShell azd exec ./build.sh -- --verbose # 腳本搭配引數 azd exec -i ./init.sh # 互動模式

azd exec [command] [args...] [-- script-args...] [flags]

選項

      --docs                 Opens the documentation for azd exec in your web browser.
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for exec.
  -i, --interactive          Run in interactive mode (connect stdin)
  -s, --shell string         Shell to use (bash, sh, zsh, pwsh, powershell, cmd). Auto-detected if not specified.

繼承自父命令的選項

  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 延伸模組安裝

安裝指定的延伸模組。

概要

透過 id 從註冊的擴充功能來源安裝一個或多個擴充功能。

--source 標誌也接受登錄檔位置(URL 或檔案路徑)。 當提供位置時,azd 會將其註冊為來源(提示名稱,並先確認網址),然後從該位置安裝。 如果該位置已經註冊,azd 會重複使用該來源。

你也可以將路徑傳遞到自包含的擴充套件(.zip):azd 會擷取並安裝該套件。 捆綁的擴充功能不會追蹤更新;從較新的套件重新安裝以進行更新。

azd extension install <extension-id|extension-bundle.zip> [flags]

選項

      --docs              Opens the documentation for azd extension install in your web browser.
  -f, --force             Force installation, including downgrades and reinstalls
  -h, --help              Gets help for install.
      --no-dependencies   Install only the specified extension(s) without installing their declared dependencies
  -s, --source string     The extension source to use for installs. Accepts a registered source name or a registry location (URL or file path) to register and install from.
  -v, --version string    The version of the extension to install

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 擴充功能清單

列出可用的擴充功能。

概要

列出來自註冊擴展來源的可用分機。

--source 標誌接受註冊的原始碼名稱或登錄檔位置(URL 或檔案路徑)。 位置查詢為唯讀,且未被註冊。 來自未註冊地點的分機則會在 SOURCE 欄位顯示該地點本身。

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
  -s, --source string   Filter extensions by registered source name or registry location (URL or file path).
      --tags strings    Filter extensions by tags

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 延伸模組顯示

顯示特定延伸模組的詳細資料。

概要

顯示來自註冊延伸來源的特定延長詳情。

--source 標誌接受註冊的原始碼名稱或登錄檔位置(URL 或檔案路徑)。 位置查詢為唯讀,且未被註冊。

azd extension show <extension-id> [flags]

選項

      --docs            Opens the documentation for azd extension show in your web browser.
  -h, --help            Gets help for show.
  -s, --source string   The registered source name or registry location (URL or file path) to use.

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 延伸模組來源新增

新增具有指定名稱的延伸模組來源

概要

新增一個指定名稱的擴充來源。

azd extension install --source 同時 azd extension upgrade --source 也接受登錄檔 URL 或檔案路徑。

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

驗證 azd 擴充套件來源

驗證擴充來源的 registry.json 檔案。

概要

驗證擴充來源的 registry.json 檔案。

接受來源名稱(來自「azd 擴充套件」的原始碼列表)、本地檔案路徑或網址。 檢查必填欄位、有效能力、語元版本格式、平台產物結構及擴充功能 ID 格式。

azd extension source validate <name-or-path-or-url> [flags]

選項

      --docs     Opens the documentation for azd extension source validate in your web browser.
  -h, --help     Gets help for validate.
      --strict   Enable strict validation (require checksums)

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 延伸模組解除安裝

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

azd extension uninstall [extension-id] [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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 延伸模組升級

將已安裝的擴充功能升級到最新版本。

概要

升級一個或多個已安裝的擴充功能。

預設情況下,會使用每個擴充功能儲存的登錄檔原始碼。 如果儲存的原始碼無法取得,則會回退到主登錄檔(azd)。 從非主登錄檔(例如 dev)安裝的擴充功能,當主登錄檔有新版本可用時,會自動升級到主登錄檔。

使用 --source 來覆寫升級的登錄檔來源。 它接受註冊的原始碼名稱或登錄檔位置(URL 或檔案路徑);位置會先被註冊,升級後擴充功能儲存的原始碼也會更新。 由於報名是互動式的,地點會被拒絕,且會被拒絕於 --no-prompt 下。 使用 --all 一次性升級所有已安裝的擴充功能;單一擴充功能故障並不會阻止其他擴充功能升級。

升級有相依性的擴充功能時,所有已安裝的相依性也會自動升級,並升級到符合擴充功能宣告限制的最高版本。 使用 --no-dependency-upgrades 來選擇退出,只升級指定的擴充功能。

使用 --output json 來建立所有升級結果的結構化報告。

azd extension upgrade [extension-id] [flags]

選項

      --all                      Upgrade all installed extensions
      --docs                     Opens the documentation for azd extension upgrade in your web browser.
  -h, --help                     Gets help for upgrade.
      --no-dependency-upgrades   Do not upgrade dependencies when upgrading an extension that has dependencies
  -s, --source string            The registered source name or registry location (URL or file path) 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
      --layer string         Only runs hooks for the specified provisioning layer.
      --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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD init

初始化新的應用程式。

概要

初始化新的應用程式。

當與 --template 一起使用時,會建立一個新的目錄(以模板命名),並在其中初始化專案——類似於 git clone。 改用「.」作為目錄,在目前的目錄中初始化。

在已初始化的專案中再次執行 init 具有冪等性:系統會重用既有環境,而不會失敗。 使用 --no-prompt 且沒有 -e 時,會重複使用錄製的預設環境。

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   ID of an Azure subscription to use for the new environment
  -t, --template string       Initializes a new application from a template. You can use a Full URI, <owner>/<repository>, <repository> if it's part of the azure-samples organization, or a local directory path (./dir, ../dir, or absolute path).
      --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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 配置

為你的專案配置 Azure 資源。

azd provision [<layer>] [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.
  -l, --location string       Azure location for the new environment
      --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.
      --subscription string   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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD秀

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

azd show [resource-name|resource-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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 樣板源添加

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

概要

索引鍵可以是可唯一識別範本來源的任何值,已知值如下: ・default: 預設範本 ・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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

移除 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD 工具

管理 Azure 開發工具。

概要

探索、安裝、升級並檢查 Azure 開發工具的狀態。

選項

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

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD 工具檢查

檢查工具升級。

azd tool check [flags]

選項

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

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd tool install

安裝指定的工具。

azd tool install [tool-name...] [flags]

選項

      --agent strings   Install the skill for the specified agent(s): copilot, claude. Use --agent all for every detected agent (skill tools only)
      --all             Install all recommended tools
      --docs            Opens the documentation for azd tool install in your web browser.
      --dry-run         Preview what would be installed without making changes
  -h, --help            Gets help for install.

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD 工具列表

列出所有工具及其狀態。

azd tool list [flags]

選項

      --docs   Opens the documentation for azd tool 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD 工具展示

顯示特定工具的詳細資訊。

azd tool show <tool-name> [flags]

選項

      --docs   Opens the documentation for azd tool 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.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 工具卸載

卸載已安裝的工具。

azd tool uninstall [tool-name...] [flags]

選項

      --agent strings   Uninstall the skill from the specified agent(s): copilot, claude. Use --agent all (or omit --agent) to remove the skill from every agent it is installed through (skill tools only)
      --all             Uninstall all installed tools
      --docs            Opens the documentation for azd tool uninstall in your web browser.
      --dry-run         Preview what would be uninstalled without making changes
  -h, --help            Gets help for uninstall.

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD 工具升級

升級安裝工具。

azd tool upgrade [tool-name...] [flags]

選項

      --agent strings   Upgrade the skill for the specified agent(s): copilot, claude. Use --agent all for every detected agent (skill tools only)
      --all             Upgrade all installed tools
      --docs            Opens the documentation for azd tool upgrade in your web browser.
      --dry-run         Preview what would be upgraded without making changes
  -h, --help            Gets help for upgrade.

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

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.
  -l, --location string       Azure location for the new environment
      --subscription string   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    Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

AZD 更新

azd 更新到最新版本。

azd update [flags]

選項

      --channel string             Update channel: stable or daily.
      --check-interval-hours int   Override the update check interval in hours.
      --docs                       Opens the documentation for azd update in your web browser.
  -h, --help                       Gets help for update.

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱

azd 版本

列印 Azure Developer CLI 的版本號。

azd version [flags]

選項

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

繼承自父命令的選項

  -C, --cwd string           Sets the current working directory.
      --debug                Enables debugging and diagnostics logging.
  -e, --environment string   The name of the environment to use.
      --no-prompt            Runs without prompts. Uses existing values; fails if any required value or decision cannot be resolved automatically. Automatically enabled when azd detects a CI/CD or AI-agent environment; set AZD_NON_INTERACTIVE=false to opt out of that automatic enablement.

另請參閱