az group

管理資源群組和範本部署。

命令

名稱 Description 類型 狀態
az group create

建立新的資源群組。

核心 GA
az group delete

刪除資源群組。

核心 GA
az group deployment

管理 Azure Resource Manager 部署。

核心 已取代
az group deployment cancel

取消目前正在執行的範本部署。

核心 已取代
az group deployment create

開始部署。

核心 已取代
az group deployment delete

從部署歷程記錄中刪除部署。

核心 已取代
az group deployment export

匯出用於某個部署的範本。

核心 已取代
az group deployment list

取得某個資源群組的所有部署。

核心 已取代
az group deployment operation

管理部署作業。

核心 已取代
az group deployment operation list

取得部署的所有部署作業。

核心 已取代
az group deployment operation show

取得部署的作業。

核心 已取代
az group deployment show

取得部署。

核心 已取代
az group deployment validate

驗證範本是否語法正確。

核心 已取代
az group deployment wait

將 CLI 置於等候狀態,直到符合部署條件為止。

核心 已取代
az group exists

檢查資源群組是否存在。

核心 GA
az group export

擷取資源群組作為範本。

核心 GA
az group list

列出資源群組。

核心 GA
az group lock

管理 Azure 資源群組鎖定。

核心 GA
az group lock create

建立資源群組鎖定。

核心 GA
az group lock delete

刪除資源群組鎖定。

核心 GA
az group lock list

列出資源群組中的鎖定資訊。

核心 GA
az group lock show

顯示資源群組鎖定的詳細數據。

核心 GA
az group lock update

更新資源群組鎖定。

核心 GA
az group show

取得資源群組。

核心 GA
az group update

更新資源群組。

核心 GA
az group wait

將 CLI 置於等候狀態,直到符合資源群組的條件為止。

核心 GA

az group create

建立新的資源群組。

az group create --location
                --name
                [--managed-by]
                [--tags]

範例

在美國西部區域建立新的資源群組。

az group create -l westus -n MyResourceGroup

必要參數

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--name --resource-group -g -n

新資源群組的名稱。

選擇性參數

--managed-by

管理此資源群組之資源的標識碼。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az group delete

刪除資源群組。

az group delete --name
                [--force-deletion-types {Microsoft.Compute/virtualMachineScaleSets, Microsoft.Compute/virtualMachines}]
                [--no-wait]
                [--yes]

範例

刪除資源群組。

az group delete -n MyResourceGroup

強制刪除資源群組中的所有 虛擬機器。

az group delete -n MyResourceGroup --force-deletion-types Microsoft.Compute/virtualMachines

必要參數

--name --resource-group -g -n

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--force-deletion-types -f

您要強制刪除的資源類型。

接受的值: Microsoft.Compute/virtualMachineScaleSets, Microsoft.Compute/virtualMachines
--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--yes -y

不提示確認。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az group exists

檢查資源群組是否存在。

az group exists --name

範例

檢查 'MyResourceGroup' 是否存在。

az group exists -n MyResourceGroup

必要參數

--name --resource-group -g -n

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az group export

擷取資源群組作為範本。

az group export --name
                [--include-comments]
                [--include-parameter-default-value]
                [--resource-ids]
                [--skip-all-params]
                [--skip-resource-name-params]

必要參數

--name --resource-group -g -n

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--include-comments

匯出具有批注的範本。

預設值: False
--include-parameter-default-value

匯出具有預設值的範本參數。

預設值: False
--resource-ids

要篩選匯出依據的空間分隔資源標識碼。 若要匯出所有資源,請勿指定此自變數或提供 “*”。

--skip-all-params

匯出範本參數並略過所有參數化。

預設值: False
--skip-resource-name-params

匯出範本並略過資源名稱參數化。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az group list

列出資源群組。

az group list [--tag]

範例

列出位於美國西部區域的所有資源群組。

az group list --query "[?location=='westus']"

選擇性參數

--tag

'key[=value]' 格式的單一標記。 使用 「清除現有的標記」。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az group show

取得資源群組。

az group show --name

必要參數

--name --resource-group -g -n

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az group update

更新資源群組。

az group update --name
                [--force-string]
                [--set]
                [--tags]

範例

更新資源群組。 ( 自動產生 )

az group update --resource-group MyResourceGroup --set tags.CostCenter='{"Dept":"IT","Environment":"Test"}'

必要參數

--name --resource-group -g -n

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

預設值: False
--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=<value>

預設值: []
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az group wait

將 CLI 置於等候狀態,直到符合資源群組的條件為止。

az group wait --name
              [--created]
              [--custom]
              [--deleted]
              [--exists]
              [--interval]
              [--timeout]
              [--updated]

範例

將 CLI 置於等候狀態,直到符合資源群組的條件為止。 ( 自動產生 )

az group wait --created  --resource-group MyResourceGroup

將 CLI 置於等候狀態,直到符合資源群組的條件為止。 ( 自動產生 )

az group wait --deleted --resource-group MyResourceGroup

必要參數

--name --resource-group -g -n

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--created

請等候在 'Succeeded' 使用 'provisioningState' 建立。

預設值: False
--custom

等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--deleted

等到刪除為止。

預設值: False
--exists

等候資源存在。

預設值: False
--interval

輪詢間隔以秒為單位。

預設值: 30
--timeout

以秒為單位的等候上限。

預設值: 3600
--updated

等到 provisioningState 更新為 'Succeeded'。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。