az monitor action-group

管理動作群組。

命令

名稱 Description 類型 狀態
az monitor action-group create

建立新的動作群組。

核心 GA
az monitor action-group delete

刪除動作群組。

核心 GA
az monitor action-group enable-receiver

在動作群組中啟用接收者。

核心 GA
az monitor action-group list

列出資源群組或目前訂用帳戶底下的動作群組。

核心 GA
az monitor action-group show

顯示動作群組的詳細資料。

核心 GA
az monitor action-group test-notifications

管理動作群組 test-notifications。

核心 GA
az monitor action-group test-notifications create

建立動作群組 test-notifications。

核心 GA
az monitor action-group update

更新動作群組。

核心 GA
az monitor action-group wait

將 CLI 置於等候狀態。

核心 GA

az monitor action-group create

建立新的動作群組。

az monitor action-group create --action-group-name
                               --resource-group
                               [--action]
                               [--group-short-name]
                               [--location]
                               [--tags]

範例

建立新的動作群組

az monitor action-group create --action webhook MyActionName https://alerts.contoso.com apiKey={APIKey} type=HighCPU --name MyActionGroup --resource-group MyResourceGroup

必要參數

--action-group-name --name -n

動作群組的名稱。

--resource-group -g

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

選擇性參數

--action --actions -a

在建立期間,將接收者新增至動作群組。 使用方式: --action TYPE NAME [ARG ...]電子郵件:格式: --action 電子郵件名稱 EMAIL_ADDRESS [usecommonalertschema] 範例: --action email bob bob@contoso.com SMS: Format: --action sms NAME COUNTRY_CODE PHONE_NUMBER範例: --action sms charli 1 5551234567 Webhook:格式:-action Webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema] 範例:-action webhook alert_hook https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema Arm Role: Format: --action armrole NAME ROLE_ID [usecommonalertschema] 範例: --action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635 Azure App Push: Format: --action azureapppush NAME EMAIL_ADDRESS範例: --action azureapppush test_apppush bob@contoso.com ITSM: Format: --action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION 範例: --action itsm test_itsm test_workspace test_conn ticket_blob useast Automation Runbook: 格式:-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema] 範例: --action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema Voice: Format: --action voice NAME COUNTRY_CODE PHONE_NUMBER Example: --action voice charli 1 4441234567 Logic App: Format: --action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema] 範例: --action logicapp test_logicapp test_rsrc http://callback Azure 函式:格式: --action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema] 範例: --action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema 事件中樞: 格式: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME test_function test_rsrc test_func [usecommonalertschema] 範例:-action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpacetestEventHubName usecommonalertschema 多個動作可以使用多個 --add-action 引數來指定。 'useaadauth'、'isglobalrunbook' 和 'usecommonalertschema' 是選擇性引數,只需要傳遞才能將個別參數設定為 True。 如果傳遞 'useaadauth' 引數,則也需要OBJECT_ID和IDENTIFIER_URI值。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--group-short-name --short-name

動作群組的簡短名稱。 這將會用於簡訊。

--location -l

位置。​​ 來自的值: az account list-locations 。 您可以使用 來設定預設位置 az configure --defaults location=<location> 。 未指定時,將會使用資源群組的位置。

預設值: Global
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 '' 清除現有的標記。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

全域參數
--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 monitor action-group delete

刪除動作群組。

az monitor action-group delete [--action-group-name]
                               [--ids]
                               [--resource-group]
                               [--subscription]

選擇性參數

--action-group-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 monitor action-group enable-receiver

在動作群組中啟用接收者。

這會將接收者的狀態從 [已停用] 變更為 [已啟用]。 只有電子郵件或 SMS 接收者才支援這項作業。

az monitor action-group enable-receiver --name
                                        [--action-group]
                                        [--ids]
                                        [--resource-group]
                                        [--subscription]

必要參數

--name --receiver-name -n

要重新訂閱的接收者名稱。

選擇性參數

--action-group --action-group-name

動作群組的名稱。

--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 monitor action-group list

列出資源群組或目前訂用帳戶底下的動作群組。

az monitor action-group list [--resource-group]

選擇性參數

--resource-group -g

資源組名。 您可以使用 來設定預設群組 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 monitor action-group show

顯示動作群組的詳細資料。

az monitor action-group show [--action-group-name]
                             [--ids]
                             [--resource-group]
                             [--subscription]

範例

顯示動作群組的詳細資料(通常與 --output 和 --query 搭配使用)。

az monitor action-group show --name MyActionGroup --resource-group MyResourceGroup

選擇性參數

--action-group-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 monitor action-group update

更新動作群組。

az monitor action-group update [--action-group-name]
                               [--add]
                               [--add-action]
                               [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                               [--group-short-name]
                               [--ids]
                               [--remove]
                               [--remove-action]
                               [--resource-group]
                               [--set]
                               [--subscription]
                               [--tags]

範例

更新動作群組

az monitor action-group update --name MyActionGroup --resource-group MyResourceGroup --set retentionPolicy.days=365 --subscription MySubscription

選擇性參數

--action-group-name --name -n

動作群組的名稱。

--add

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

--add-action --add-actions -a

將接收者新增至動作群組。 使用方式:--add-action TYPE NAME [ARG ...]電子郵件:格式: --add-action 電子郵件名稱 EMAIL_ADDRESS [usecommonalertschema] 範例: --add-action 電子郵件 bob bob@contoso.com SMS: 格式: --add-action sms NAME COUNTRY_CODE PHONE_NUMBER範例: --add-action sms charli 1 5551234567 Webhook:格式: --add-action Webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema] 範例: --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema Arm Role: Format: --add-action armrole NAME ROLE_ID [usecommonalertschema] 範例: --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635 Azure 應用程式推送:格式:--add-action azureapppush NAME EMAIL_ADDRESS範例:--add-action azureapppush test_apppush bob@contoso.com ITSM:Format: --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION 範例:--add-action itsm test_itsm test_workspace test_conn ticket_blob useast Automation Runbook: 格式:--add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema] 範例:--add-action automationrunbook test_runbook test_acc test_book test_webhook test_rsrc http://example.com isglobalrunbook usecommonalertschema Voice: Format: --add-action voice NAME COUNTRY_CODE PHONE_NUMBER Example: --add-action voice charli 1 4441234567 Logic App: Format: --add-action logicapp NAME RESOURCE_ID CALLBACK_URL [usecommonalertschema] 範例: --add-action logicapp test_logicapp test_rsrc Azure 函式: 格式: --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL http://callback [usecommonalertschema] 範例: --add-action azurefunction http://trigger test_function test_rsrc test_func usecommonalertschema 事件中樞: 格式: --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema] 範例: --action eventhub test_eventhub5def922a-3ed4-49c1-b9fd-05ec5333819a3 eventhubName testEventHubName usecommonalertschema Multiple 動作可以使用多個 --add-action 引數來指定。 'useaadauth'、'isglobalrunbook' 和 'usecommonalertschema' 是選擇性引數,只需要傳遞才能將個別參數設定為 True。 如果傳遞 'useaadauth' 引數,則也需要OBJECT_ID和IDENTIFIER_URI值。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--force-string

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

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

動作群組的簡短名稱。 這將會用於簡訊。

--ids

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

--remove

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

--remove-action -r

從動作群組中移除接收者。 接受以空格分隔的接收者名稱清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--resource-group -g

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

--set

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

--subscription

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

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 '' 清除現有的標記。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

全域參數
--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 monitor action-group wait

將 CLI 置於等候狀態。

az monitor action-group wait [--created]
                             [--custom]
                             [--deleted]
                             [--exists]
                             [--ids]
                             [--interval]
                             [--name]
                             [--resource-group]
                             [--subscription]
                             [--timeout]
                             [--updated]

選擇性參數

--created

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

預設值: False
--custom

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

--deleted

等到刪除為止。

預設值: False
--exists

等候資源存在。

預設值: False
--ids

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

--interval

輪詢間隔以秒為單位。

預設值: 30
--name -n

動作群組的名稱。 必要。

--resource-group -g

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

--subscription

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

--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 來取得完整偵錯記錄。