az group
管理資源群組和範本部署。
命令
名稱 | Description | 類型 | 狀態 |
---|---|---|---|
az group create |
建立新的資源群組。 |
Core | GA |
az group delete |
刪除資源群組。 |
Core | GA |
az group exists |
檢查資源群組是否存在。 |
Core | GA |
az group export |
擷取資源群組作為範本。 |
Core | GA |
az group list |
列出資源群組。 |
Core | GA |
az group lock |
管理 Azure 資源群組鎖定。 |
Core | GA |
az group lock create |
建立資源群組鎖定。 |
Core | GA |
az group lock delete |
刪除資源群組鎖定。 |
Core | GA |
az group lock list |
列出資源群組中的鎖定資訊。 |
Core | GA |
az group lock show |
顯示資源群組鎖定的詳細數據。 |
Core | GA |
az group lock update |
更新資源群組鎖定。 |
Core | GA |
az group show |
取得資源群組。 |
Core | GA |
az group update |
更新資源群組。 |
Core | GA |
az group wait |
將 CLI 置於等候狀態,直到符合資源群組的條件為止。 |
Core | GA |
az group create
建立新的資源群組。
az group create --location
--name --resource-group
[--managed-by]
[--tags]
範例
在美國西部區域建立新的資源群組。
az group create -l westus -n MyResourceGroup
必要參數
Location. 值的來源:az account list-locations
。 您可以使用 az configure --defaults location=<location>
來設定預設位置。
新資源群組的名稱。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
管理此資源群組之資源的標識碼。
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az group delete
刪除資源群組。
az group delete --name --resource-group
[--force-deletion-types {Microsoft.Compute/virtualMachineScaleSets, Microsoft.Compute/virtualMachines, Microsoft.Databricks/workspaces}]
[--no-wait]
[--yes]
範例
刪除資源群組。
az group delete -n MyResourceGroup
強制刪除資源群組中的所有虛擬機。
az group delete -n MyResourceGroup --force-deletion-types Microsoft.Compute/virtualMachines
必要參數
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
您要強制刪除的資源類型。
屬性 | 值 |
---|---|
接受的值: | Microsoft.Compute/virtualMachineScaleSets, Microsoft.Compute/virtualMachines, Microsoft.Databricks/workspaces |
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
預設值: | False |
請勿提示確認。
屬性 | 值 |
---|---|
預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az group exists
檢查資源群組是否存在。
az group exists --name --resource-group
範例
檢查 'MyResourceGroup' 是否存在。
az group exists -n MyResourceGroup
必要參數
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az group export
擷取資源群組作為範本。
az group export --name --resource-group
[--include-comments]
[--include-parameter-default-value]
[--resource-ids]
[--skip-all-params]
[--skip-resource-name-params]
必要參數
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
匯出具有批注的範本。
屬性 | 值 |
---|---|
預設值: | False |
匯出具有預設值的範本參數。
屬性 | 值 |
---|---|
預設值: | False |
要篩選匯出依據的空間分隔資源標識碼。 若要匯出所有資源,請勿指定此自變數或提供 “*”。
匯出範本參數並略過所有參數化。
屬性 | 值 |
---|---|
預設值: | False |
匯出範本並略過資源名稱參數化。
屬性 | 值 |
---|---|
預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az group list
列出資源群組。
az group list [--tag]
範例
列出位於美國西部區域的所有資源群組。
az group list --query "[?location=='westus']"
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
'key[=value]' 格式的單一標記。 使用 「清除現有的標記」。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az group show
取得資源群組。
az group show --name --resource-group
必要參數
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az group update
更新資源群組。
az group update --name --resource-group
[--force-string]
[--set]
[--tags]
範例
更新資源群組。 (autogenerated)
az group update --resource-group MyResourceGroup --set tags.CostCenter='{"Dept":"IT","Environment":"Test"}'
必要參數
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。
屬性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
預設值: | False |
指定要設定的屬性路徑和值,以更新物件。 範例: --set property1.property2=<value>
.
屬性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
預設值: | [] |
以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az group wait
將 CLI 置於等候狀態,直到符合資源群組的條件為止。
az group wait --name --resource-group
[--created]
[--custom]
[--deleted]
[--exists]
[--interval]
[--timeout]
[--updated]
範例
將 CLI 置於等候狀態,直到符合資源群組的條件為止。 (autogenerated)
az group wait --created --resource-group MyResourceGroup
將 CLI 置於等候狀態,直到符合資源群組的條件為止。 (autogenerated)
az group wait --deleted --resource-group MyResourceGroup
必要參數
資源組名。 您可以使用 az configure --defaults group=<name>
來設定預設群組。
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
請等候在 'Succeeded' 使用 'provisioningState' 建立。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | False |
等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
等到刪除為止。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | False |
等候資源存在。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | False |
輪詢間隔以秒為單位。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | 30 |
以秒為單位的等候上限。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | 3600 |
等到 provisioningState 更新為 'Succeeded'。
屬性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID
來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |