共用方式為


az maintenance assignment

注意

此參考是 Azure CLI 的 維護 延伸模組的一部分(2.67.0 版或更高版本)。 擴充功能會在您第一次執行 az maintenance assignment 命令時自動安裝 深入瞭解擴充功能

使用維護管理組態指派。

命令

名稱 Description 類型 狀態
az maintenance assignment create

將維護更新套用至資源。

外延 加語
az maintenance assignment create-or-update-parent

使用父代將維護更新套用至資源。

外延 加語
az maintenance assignment create-or-update-resource-group

建立資源的組態。

外延 實驗的
az maintenance assignment create-or-update-subscription

建立資源的組態。

外延 實驗的
az maintenance assignment delete

刪除資源的組態。

外延 加語
az maintenance assignment delete-parent

刪除資源的組態。

外延 加語
az maintenance assignment delete-resource-group

刪除資源的組態。

外延 實驗的
az maintenance assignment delete-subscription

刪除資源的組態。

外延 實驗的
az maintenance assignment list

列出資源的組態指派。

外延 加語
az maintenance assignment list-parent

列出資源的組態指派。

外延 加語
az maintenance assignment list-subscription

列出訂用帳戶內的組態指派。

外延 實驗的
az maintenance assignment show

取得 resource 的組態指派。

外延 加語
az maintenance assignment show-parent

取得 resource 的組態指派。

外延 加語
az maintenance assignment show-resource-group

取得 resource 的組態指派。

外延 實驗的
az maintenance assignment show-subscription

取得 resource 的組態指派。

外延 實驗的
az maintenance assignment update

更新資源的組態。

外延 加語
az maintenance assignment update-parent

更新資源的組態。

外延 加語
az maintenance assignment update-resource-group

更新資源的組態。

外延 實驗的
az maintenance assignment update-subscription

更新資源的組態。

外延 實驗的

az maintenance assignment create

將維護更新套用至資源。

az maintenance assignment create --configuration-assignment-name
                                 --provider-name
                                 --resource-group
                                 --resource-name
                                 --resource-type
                                 [--config-id]
                                 [--filter-locations]
                                 [--filter-os-types]
                                 [--filter-resource-groups]
                                 [--filter-resource-types]
                                 [--filter-tags]
                                 [--filter-tags-operator {All, Any}]
                                 [--location]
                                 [--resource-id]

範例

ConfigurationAssignments_CreateOrUpdate

az maintenance assignment create --maintenance-configuration-id "/subscriptions/00000000-0000-0000-0000-00000000/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1" --name "workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "test1" --resource-type "virtualMachineScaleSets"

必要參數

--configuration-assignment-name --name -n

組態指派名稱。

--provider-name

資源提供者名稱。

--resource-group -g

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

--resource-name

資源標識碼。

--resource-type

資源類型。

選擇性參數

--config-id --maintenance-configuration-id

維護組態標識碼。

--filter-locations

要設定查詢範圍的位置清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-os-types

允許的作業系統清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-groups

允許的資源群組清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-types

允許的資源清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags

標記的字典及其值清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags-operator

依 [任何] 或 [所有] 指定的標籤篩選 VM。

接受的值: All, Any
--location -l

資源的位置。

--resource-id

unique resourceId。

全域參數
--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 maintenance assignment create-or-update-parent

使用父代將維護更新套用至資源。

az maintenance assignment create-or-update-parent [--config-id]
                                                  [--configuration-assignment-name]
                                                  [--filter-locations]
                                                  [--filter-os-types]
                                                  [--filter-resource-groups]
                                                  [--filter-resource-types]
                                                  [--filter-tags]
                                                  [--filter-tags-operator {All, Any}]
                                                  [--ids]
                                                  [--location]
                                                  [--provider-name]
                                                  [--resource-group]
                                                  [--resource-id]
                                                  [--resource-name]
                                                  [--resource-parent-name]
                                                  [--resource-parent-type]
                                                  [--resource-type]
                                                  [--subscription]

範例

ConfigurationAssignments_CreateOrUpdateParent

az maintenance assignment create-or-update-parent --maintenance-configuration-id "/subscriptions/00000000-0000-0000-0000-00000000/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1" --name "workervmPolicy" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdvm1" --resource-parent-name "test1" --resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"

選擇性參數

--config-id --maintenance-configuration-id

維護組態標識碼。

--configuration-assignment-name --name -n

組態指派名稱。

--filter-locations

要設定查詢範圍的位置清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-os-types

允許的作業系統清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-groups

允許的資源群組清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-types

允許的資源清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags

標記的字典及其值清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags-operator

依 [任何] 或 [所有] 指定的標籤篩選 VM。

接受的值: All, Any
--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

資源的位置。

--provider-name

資源提供者名稱。

--resource-group -g

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

--resource-id

unique resourceId。

--resource-name

資源標識碼。

--resource-parent-name

資源父標識碼。

--resource-parent-type

資源父類型。

--resource-type

資源類型。

--subscription

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

全域參數
--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 maintenance assignment create-or-update-resource-group

實驗

此命令是實驗性且正在開發中。 參考和支持層級:https://aka.ms/CLI_refstatus

建立資源的組態。

az maintenance assignment create-or-update-resource-group [--config-id]
                                                          [--configuration-assignment-name]
                                                          [--filter-locations]
                                                          [--filter-os-types]
                                                          [--filter-resource-groups]
                                                          [--filter-resource-types]
                                                          [--filter-tags]
                                                          [--filter-tags-operator {All, Any}]
                                                          [--ids]
                                                          [--location]
                                                          [--resource-group]
                                                          [--resource-id]
                                                          [--subscription]

範例

ConfigurationAssignments_CreateOrUpdateResourceGroup

az maintenance assignment create-or-update-resource-group  --maintenance-configuration-id "/subscriptions/00000000-0000-0000-0000-00000000/resourcegroups/exmaplerg2/providers/Microsoft. Maintenance/maintenanceConfigurations/config1"  --name assignmentname  --filter-locations eastus2euap centraluseuap  --filter-os-types windows linux  --filter-tags "{tagKey1:[tagKey1Val1,tagKey1Val2],tagKey2:[tagKey2Val1,tagKey2Val2]}"  --filter-tags-operator All  --resource-group examplerg1

選擇性參數

--config-id --maintenance-configuration-id

維護組態標識碼。

--configuration-assignment-name --name -n

組態指派名稱。

--filter-locations

要設定查詢範圍的位置清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-os-types

允許的作業系統清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-groups

允許的資源群組清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-types

允許的資源清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags

標記的字典及其值清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags-operator

依 [任何] 或 [所有] 指定的標籤篩選 VM。

接受的值: All, Any
--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

資源的位置。

--resource-group -g

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

--resource-id

unique resourceId。

--subscription

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

全域參數
--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 maintenance assignment create-or-update-subscription

實驗

此命令是實驗性且正在開發中。 參考和支持層級:https://aka.ms/CLI_refstatus

建立資源的組態。

az maintenance assignment create-or-update-subscription [--config-id]
                                                        [--configuration-assignment-name]
                                                        [--filter-locations]
                                                        [--filter-os-types]
                                                        [--filter-resource-groups]
                                                        [--filter-resource-types]
                                                        [--filter-tags]
                                                        [--filter-tags-operator {All, Any}]
                                                        [--ids]
                                                        [--location]
                                                        [--resource-id]
                                                        [--subscription]

範例

ConfigurationAssignments_CreateOrUpdateSubscription

az maintenance assignment create-or-update-subscription  --maintenance-configuration-id "/subscriptions/00000000-0000-0000-0000-00000000/resourcegroups/exmaplerg2/providers/Microsoft. Maintenance/maintenanceConfigurations/config1"  --name assignmentname  --filter-locations eastus2euap centraluseuap  --filter-os-types windows linux  --filter-tags "{tagKey1:[tagKey1Val1,tagKey1Val2],tagKey2:[tagKey2Val1,tagKey2Val2]}"  --filter-tags-operator All

選擇性參數

--config-id --maintenance-configuration-id

維護組態標識碼。

--configuration-assignment-name --name -n

組態指派名稱。

--filter-locations

要設定查詢範圍的位置清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-os-types

允許的作業系統清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-groups

允許的資源群組清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-types

允許的資源清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags

標記的字典及其值清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags-operator

依 [任何] 或 [所有] 指定的標籤篩選 VM。

接受的值: All, Any
--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

資源的位置。

--resource-id

unique resourceId。

--subscription

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

全域參數
--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 maintenance assignment delete

刪除資源的組態。

az maintenance assignment delete [--configuration-assignment-name]
                                 [--ids]
                                 [--provider-name]
                                 [--resource-group]
                                 [--resource-name]
                                 [--resource-type]
                                 [--subscription]
                                 [--yes]

範例

ConfigurationAssignments_Delete

az maintenance assignment delete --name "workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdtest1" --resource-type "virtualMachineScaleSets"

選擇性參數

--configuration-assignment-name --name -n

唯一的組態指派名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--provider-name

資源提供者名稱。

--resource-group -g

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

--resource-name

資源標識碼。

--resource-type

資源類型。

--subscription

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

--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 maintenance assignment delete-parent

刪除資源的組態。

az maintenance assignment delete-parent [--configuration-assignment-name]
                                        [--ids]
                                        [--provider-name]
                                        [--resource-group]
                                        [--resource-name]
                                        [--resource-parent-name]
                                        [--resource-parent-type]
                                        [--resource-type]
                                        [--subscription]
                                        [--yes]

範例

ConfigurationAssignments_DeleteParent

az maintenance assignment delete-parent --name "workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"

選擇性參數

--configuration-assignment-name --name -n

唯一的組態指派名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--provider-name

資源提供者名稱。

--resource-group -g

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

--resource-name

資源標識碼。

--resource-parent-name

資源父標識碼。

--resource-parent-type

資源父類型。

--resource-type

資源類型。

--subscription

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

--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 maintenance assignment delete-resource-group

實驗

此命令是實驗性且正在開發中。 參考和支持層級:https://aka.ms/CLI_refstatus

刪除資源的組態。

az maintenance assignment delete-resource-group [--configuration-assignment-name]
                                                [--ids]
                                                [--resource-group]
                                                [--subscription]
                                                [--yes]

範例

ConfigurationAssignments_DeleteSubscription

az maintenance assignment delete-resource-group --resource-group "examplerg" --name "example1"

選擇性參數

--configuration-assignment-name --name -n

唯一的組態指派名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--resource-group -g

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

--subscription

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

--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 maintenance assignment delete-subscription

實驗

此命令是實驗性且正在開發中。 參考和支持層級:https://aka.ms/CLI_refstatus

刪除資源的組態。

az maintenance assignment delete-subscription [--configuration-assignment-name]
                                              [--ids]
                                              [--subscription]
                                              [--yes]

範例

ConfigurationAssignments_DeleteSubscription

az maintenance assignment delete-subscription --name "example1"

選擇性參數

--configuration-assignment-name --name -n

唯一的組態指派名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--subscription

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

--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 maintenance assignment list

列出資源的組態指派。

az maintenance assignment list --provider-name
                               --resource-group
                               --resource-name
                               --resource-type

範例

ConfigurationAssignments_List

az maintenance assignment list --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdtest1" --resource-type "virtualMachineScaleSets"

必要參數

--provider-name

資源提供者名稱。

--resource-group -g

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

--resource-name

資源標識碼。

--resource-type

資源類型。

全域參數
--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 maintenance assignment list-parent

列出資源的組態指派。

az maintenance assignment list-parent [--ids]
                                      [--provider-name]
                                      [--resource-group]
                                      [--resource-name]
                                      [--resource-parent-name]
                                      [--resource-parent-type]
                                      [--resource-type]
                                      [--subscription]

範例

ConfigurationAssignments_ListParent

az maintenance assignment list-parent --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdtestvm1" --resource-parent-name "smdtest1" --resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"

選擇性參數

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--provider-name

資源提供者名稱。

--resource-group -g

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

--resource-name

資源標識碼。

--resource-parent-name

資源父標識碼。

--resource-parent-type

資源父類型。

--resource-type

資源類型。

--subscription

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

全域參數
--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 maintenance assignment list-subscription

實驗

此命令是實驗性且正在開發中。 參考和支持層級:https://aka.ms/CLI_refstatus

列出訂用帳戶內的組態指派。

az maintenance assignment list-subscription

範例

ConfigurationAssignments_List

az maintenance assignment list-subscription
全域參數
--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 maintenance assignment show

取得 resource 的組態指派。

az maintenance assignment show [--configuration-assignment-name]
                               [--ids]
                               [--provider-name]
                               [--resource-group]
                               [--resource-name]
                               [--resource-type]
                               [--subscription]

範例

ConfigurationAssignments_Get

az maintenance assignment show --name "workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdtest1" --resource-type "virtualMachineScaleSets"

選擇性參數

--configuration-assignment-name --name -n

組態指派名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--provider-name

資源提供者名稱。

--resource-group -g

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

--resource-name

資源標識碼。

--resource-type

資源類型。

--subscription

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

全域參數
--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 maintenance assignment show-parent

取得 resource 的組態指派。

az maintenance assignment show-parent [--configuration-assignment-name]
                                      [--ids]
                                      [--provider-name]
                                      [--resource-group]
                                      [--resource-name]
                                      [--resource-parent-name]
                                      [--resource-parent-type]
                                      [--resource-type]
                                      [--subscription]

範例

ConfigurationAssignments_GetParent

az maintenance assignment show-parent --name "workervmPolicy" --provider-name  "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdvm1" --resource-parent- name "smdtest1" --resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"

選擇性參數

--configuration-assignment-name --name -n

組態指派名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--provider-name

資源提供者名稱。

--resource-group -g

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

--resource-name

資源標識碼。

--resource-parent-name

資源父標識碼。

--resource-parent-type

資源父類型。

--resource-type

資源類型。

--subscription

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

全域參數
--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 maintenance assignment show-resource-group

實驗

此命令是實驗性且正在開發中。 參考和支持層級:https://aka.ms/CLI_refstatus

取得 resource 的組態指派。

az maintenance assignment show-resource-group [--configuration-assignment-name]
                                              [--ids]
                                              [--resource-group]
                                              [--subscription]

範例

ConfigurationAssignments_GetResourceGroup

az maintenance assignment show-subscription --resource-group "examplerg" --name "example1"

選擇性參數

--configuration-assignment-name --name -n

組態指派名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--resource-group -g

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

--subscription

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

全域參數
--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 maintenance assignment show-subscription

實驗

此命令是實驗性且正在開發中。 參考和支持層級:https://aka.ms/CLI_refstatus

取得 resource 的組態指派。

az maintenance assignment show-subscription [--configuration-assignment-name]
                                            [--ids]
                                            [--subscription]

範例

ConfigurationAssignments_GetSubscription

az maintenance assignment show-subscription --name "example1"

選擇性參數

--configuration-assignment-name --name -n

組態指派名稱。

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--subscription

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

全域參數
--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 maintenance assignment update

更新資源的組態。

az maintenance assignment update [--add]
                                 [--config-id]
                                 [--configuration-assignment-name]
                                 [--filter-locations]
                                 [--filter-os-types]
                                 [--filter-resource-groups]
                                 [--filter-resource-types]
                                 [--filter-tags]
                                 [--filter-tags-operator {All, Any}]
                                 [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                 [--ids]
                                 [--location]
                                 [--provider-name]
                                 [--remove]
                                 [--resource-group]
                                 [--resource-id]
                                 [--resource-name]
                                 [--resource-type]
                                 [--set]
                                 [--subscription]

範例

ConfigurationAssignments_Update

az maintenance assignment update --maintenance-configuration-id "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1" --name "workervmConfiguration" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdtest1" --resource-type "virtualMachineScaleSets"

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value, string or JSON string>

--config-id --maintenance-configuration-id

維護組態標識碼。

--configuration-assignment-name --name -n

組態指派名稱。

--filter-locations

要設定查詢範圍的位置清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-os-types

允許的作業系統清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-groups

允許的資源群組清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-types

允許的資源清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags

標記的字典及其值清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags-operator

依 [任何] 或 [所有] 指定的標籤篩選 VM。

接受的值: All, Any
--force-string

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

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

資源的位置。

--provider-name

資源提供者名稱。

--remove

從清單中移除屬性或專案。 範例:--remove property.list <indexToRemove> OR --remove propertyToRemove

--resource-group -g

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

--resource-id

unique resourceId。

--resource-name

資源標識碼。

--resource-type

資源類型。

--set

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

--subscription

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

全域參數
--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 maintenance assignment update-parent

更新資源的組態。

az maintenance assignment update-parent [--config-id]
                                        [--configuration-assignment-name]
                                        [--filter-locations]
                                        [--filter-os-types]
                                        [--filter-resource-groups]
                                        [--filter-resource-types]
                                        [--filter-tags]
                                        [--filter-tags-operator {All, Any}]
                                        [--ids]
                                        [--location]
                                        [--provider-name]
                                        [--resource-group]
                                        [--resource-id]
                                        [--resource-name]
                                        [--resource-parent-name]
                                        [--resource-parent-type]
                                        [--resource-type]
                                        [--subscription]

範例

ConfigurationAssignments_UpdateParent

az maintenance assignment update-parent --maintenance-configuration-id "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1" --name "workervmPolicy" --provider-name "Microsoft.Compute" --resource-group "examplerg" --resource-name "smdvm1" --resource-parent-name "smdtest1" --resource-parent-type "virtualMachineScaleSets" --resource-type "virtualMachines"

選擇性參數

--config-id --maintenance-configuration-id

維護組態標識碼。

--configuration-assignment-name --name -n

組態指派名稱。

--filter-locations

要設定查詢範圍的位置清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-os-types

允許的作業系統清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-groups

允許的資源群組清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-types

允許的資源清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags

標記的字典及其值清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags-operator

依 [任何] 或 [所有] 指定的標籤篩選 VM。

接受的值: All, Any
--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

資源的位置。

--provider-name

資源提供者名稱。

--resource-group -g

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

--resource-id

unique resourceId。

--resource-name

資源標識碼。

--resource-parent-name

資源父標識碼。

--resource-parent-type

資源父類型。

--resource-type

資源類型。

--subscription

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

全域參數
--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 maintenance assignment update-resource-group

實驗

此命令是實驗性且正在開發中。 參考和支持層級:https://aka.ms/CLI_refstatus

更新資源的組態。

az maintenance assignment update-resource-group [--config-id]
                                                [--configuration-assignment-name]
                                                [--filter-locations]
                                                [--filter-os-types]
                                                [--filter-resource-groups]
                                                [--filter-resource-types]
                                                [--filter-tags]
                                                [--filter-tags-operator {All, Any}]
                                                [--ids]
                                                [--location]
                                                [--resource-group]
                                                [--resource-id]
                                                [--subscription]

範例

ConfigurationAssignments_UpdateResourceGroup

az maintenance assignment create-or-update-resource-group --maintenance-configuration-id "/subscriptions/00000000-0000-0000-0000-00000000/resourcegroups/exmaplerg2/providers/Microsoft. Maintenance/maintenanceConfigurations/config1" --name assignmentname --filter-locations eastus2euap centraluseuap --filter-os-types windows linux --filter-tags "{tagKey1:[tagKey1Val1,tagKey1Val2],tagKey2:[tagKey2Val1,tagKey2Val2]}" --filter-tags-operator All --resource-group examplerg1

選擇性參數

--config-id --maintenance-configuration-id

維護組態標識碼。

--configuration-assignment-name --name -n

組態指派名稱。

--filter-locations

要設定查詢範圍的位置清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-os-types

允許的作業系統清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-groups

允許的資源群組清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-types

允許的資源清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags

標記的字典及其值清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags-operator

依 [任何] 或 [所有] 指定的標籤篩選 VM。

接受的值: All, Any
--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

資源的位置。

--resource-group -g

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

--resource-id

unique resourceId。

--subscription

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

全域參數
--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 maintenance assignment update-subscription

實驗

此命令是實驗性且正在開發中。 參考和支持層級:https://aka.ms/CLI_refstatus

更新資源的組態。

az maintenance assignment update-subscription [--config-id]
                                              [--configuration-assignment-name]
                                              [--filter-locations]
                                              [--filter-os-types]
                                              [--filter-resource-groups]
                                              [--filter-resource-types]
                                              [--filter-tags]
                                              [--filter-tags-operator {All, Any}]
                                              [--ids]
                                              [--location]
                                              [--resource-id]
                                              [--subscription]

範例

ConfigurationAssignments_UpdateSubscription

az maintenance assignment update-subscription  --maintenance-configuration-id "/subscriptions/00000000-0000-0000-0000-00000000/resourcegroups/exmaplerg2/providers/Microsoft. Maintenance/maintenanceConfigurations/config1"  --name assignmentname  --filter-locations eastus2euap centraluseuap  --filter-os-types windows linux  --filter-tags "{tagKey1:[tagKey1Val1,tagKey1Val2],tagKey2:[tagKey2Val1,tagKey2Val2]}"  --filter-tags-operator All

選擇性參數

--config-id --maintenance-configuration-id

維護組態標識碼。

--configuration-assignment-name --name -n

組態指派名稱。

--filter-locations

要設定查詢範圍的位置清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-os-types

允許的作業系統清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-groups

允許的資源群組清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-resource-types

允許的資源清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags

標記的字典及其值清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--filter-tags-operator

依 [任何] 或 [所有] 指定的標籤篩選 VM。

接受的值: All, Any
--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

資源的位置。

--resource-id

unique resourceId。

--subscription

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

全域參數
--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。