你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az monitor action-group

管理操作组。

命令

名称 说明 类型 Status
az monitor action-group create

创建新的操作组。

核心 乔治亚州
az monitor action-group delete

删除作组。

核心 乔治亚州
az monitor action-group enable-receiver

在作组中启用接收方。

核心 乔治亚州
az monitor action-group identity

管理作组的标识。

核心 乔治亚州
az monitor action-group identity assign

分配用户或系统托管标识。

核心 乔治亚州
az monitor action-group identity remove

删除用户或系统托管标识。

核心 乔治亚州
az monitor action-group identity show

显示托管标识的详细信息。

核心 乔治亚州
az monitor action-group list

列出资源组或当前订阅下的操作组。

核心 乔治亚州
az monitor action-group show

显示操作组的详细信息。

核心 乔治亚州
az monitor action-group test-notifications

管理操作组测试通知。

核心 乔治亚州
az monitor action-group test-notifications create

创建操作组测试通知。

核心 乔治亚州
az monitor action-group update

更新操作组。

核心 乔治亚州
az monitor action-group wait

将 CLI 置于等待状态。

核心 乔治亚州

az monitor action-group create

创建新的操作组。

az monitor action-group create --action-group-name --name
                               --resource-group
                               [--action --actions]
                               [--arm-role-receivers]
                               [--automation-runbook-receivers]
                               [--azure-app-push-receivers]
                               [--azure-function-receivers]
                               [--email-receivers]
                               [--enabled {0, 1, f, false, n, no, t, true, y, yes}]
                               [--event-hub-receivers]
                               [--group-short-name --short-name]
                               [--incident-receivers]
                               [--itsm-receivers]
                               [--___location]
                               [--logic-app-receivers]
                               [--mi-system-assigned --system-assigned]
                               [--mi-user-assigned --user-assigned]
                               [--sms-receivers]
                               [--tags]
                               [--voice-receivers]
                               [--webhook-receivers]

示例

创建新作组

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

在创建过程中将接收方添加到作组。

    Usage:   --action TYPE NAME [ARG ...]


    Email:


        Format:     --action email NAME EMAIL_ADDRESS [usecommonalertschema]


        Example:    --action email bob bob@contoso.com


    SMS:


        Format:     --action sms NAME COUNTRY_CODE PHONE_NUMBER


        Example:    --action sms charli 1 5551234567


    Webhook:


        Format:     --action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]


        Example:    --action webhook alert_hook https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema


    Arm Role:


        Format:     --action armrole NAME ROLE_ID [usecommonalertschema]


        Example:    --action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635


    Azure App Push:


        Format:     --action azureapppush NAME EMAIL_ADDRESS


        Example:    --action azureapppush test_apppush bob@contoso.com


    ITSM:


        Format:     --action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION


        Example:    --action itsm test_itsm test_workspace test_conn ticket_blob useast


    Automation runbook:


        Format:     --action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]


        Example:    --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]


        Example:    --action logicapp test_logicapp test_rsrc http://callback


    Azure Function:


        Format:     --action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]


        Example:    --action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema


    Event Hub:


        Format:     --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]


        Example:    --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema


    Multiple actions can be specified by using more than one `--add-action` argument.


    'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements that only need to be passed to set the respective parameter to True.


    If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.
      Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
--arm-role-receivers

属于此操作组的 ARM 角色接收器列表。 角色是 Azure RBAC 角色,仅支持内置角色。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--automation-runbook-receivers

属于此操作组的 AutomationRunbook 接收器的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--azure-app-push-receivers

属于此操作组的 AzureAppPush 接收器列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--azure-function-receivers

属于此操作组的 Azure 函数接收器的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--email-receivers

属于此操作组的电子邮件接收方列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--enabled

指示是否启用此操作组。 如果未启用操作组,则其接收方不会接收通信。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
默认值: True
--event-hub-receivers

属于此操作组的事件中心接收器的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

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

操作组的短名称。 这将在短信中使用。

--incident-receivers

属于此操作组的事件接收器的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--itsm-receivers

属于此操作组的 ITSM 接收器的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--___location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults ___location=<___location> 配置默认位置。 如果未指定,将使用资源组的位置。

默认值: Global
--logic-app-receivers

属于此操作组的逻辑应用接收器列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--mi-system-assigned --system-assigned

设置系统托管标识。

--mi-user-assigned --user-assigned

设置用户托管标识。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--sms-receivers

属于此操作组的 SMS 接收器列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--tags

空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--voice-receivers

属于此操作组的语音接收器列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--webhook-receivers

属于此操作组的 Webhook 接收器列表。 支持速记语法、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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

az monitor action-group delete

删除作组。

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

可选参数

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

作组的名称。

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

az monitor action-group enable-receiver

在作组中启用接收方。

这会将接收方的状态从“已禁用”更改为“已启用”。 仅电子邮件或短信接收方支持此作。

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

必需参数

--name --receiver-name -n

要重新订阅的接收方的名称。

可选参数

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

作组的名称。

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

az monitor action-group show

显示操作组的详细信息。

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

示例

显示作组的详细信息(通常用于 --output 和 --query)。

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

可选参数

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

作组的名称。

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

az monitor action-group update

更新操作组。

az monitor action-group update [--action-group-name --name]
                               [--add]
                               [--add-action --add-actions]
                               [--arm-role-receivers]
                               [--automation-runbook-receivers]
                               [--azure-app-push-receivers]
                               [--azure-function-receivers]
                               [--email-receivers]
                               [--enabled {0, 1, f, false, n, no, t, true, y, yes}]
                               [--event-hub-receivers]
                               [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                               [--group-short-name --short-name]
                               [--ids]
                               [--incident-receivers]
                               [--itsm-receivers]
                               [--logic-app-receivers]
                               [--remove]
                               [--remove-action]
                               [--resource-group]
                               [--set]
                               [--sms-receivers]
                               [--subscription]
                               [--tags]
                               [--voice-receivers]
                               [--webhook-receivers]

示例

更新作组

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 or JSON string>

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

将接收方添加到作组。

    Usage:   --add-action TYPE NAME [ARG ...]


    Email:


        Format:     --add-action email NAME EMAIL_ADDRESS [usecommonalertschema]


        Example:    --add-action email bob bob@contoso.com


    SMS:


        Format:     --add-action sms NAME COUNTRY_CODE PHONE_NUMBER


        Example:    --add-action sms charli 1 5551234567


    Webhook:


        Format:     --add-action webhook NAME URI [useaadauth OBJECT_ID IDENTIFIER URI] [usecommonalertschema]


        Example:    --add-action https://www.contoso.com/alert useaadauth testobj http://identifier usecommonalertschema


    Arm Role:


        Format:     --add-action armrole NAME ROLE_ID [usecommonalertschema]


        Example:    --add-action armole owner_role 8e3af657-a8ff-443c-a75c-2fe8c4bcb635


    Azure App Push:


        Format:     --add-action azureapppush NAME EMAIL_ADDRESS


        Example:    --add-action azureapppush test_apppush bob@contoso.com


    ITSM:


        Format:     --add-action itsm NAME WORKSPACE_ID CONNECTION_ID TICKET_CONFIGURATION REGION


        Example:    --add-action itsm test_itsm test_workspace test_conn ticket_blob useast


    Automation runbook:


        Format:     --add-action automationrunbook NAME AUTOMATION_ACCOUNT_ID RUNBOOK_NAME WEBHOOK_RESOURCE_ID SERVICE_URI [isglobalrunbook] [usecommonalertschema]


        Example:    --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]


        Example:    --add-action logicapp test_logicapp test_rsrc http://callback


    Azure Function:


        Format:     --add-action azurefunction NAME FUNCTION_APP_RESOURCE_ID FUNCTION_NAME HTTP_TRIGGER_URL [usecommonalertschema]


        Example:    --add-action azurefunction test_function test_rsrc test_func http://trigger usecommonalertschema


    Event Hub:


        Format:     --action eventhub NAME SUBSCRIPTION_ID EVENT_HUB_NAME_SPACE EVENT_HUB_NAME [usecommonalertschema]


        Example:    --action eventhub test_eventhub 5def922a-3ed4-49c1-b9fd-05ec533819a3 eventhubNameSpace testEventHubName usecommonalertschema


    Multiple actions can be specified by using more than one `--add-action` argument.


    'useaadauth', 'isglobalrunbook' and 'usecommonalertschema' are optional arguements that only need to be passed to set the respective parameter to True.


    If the 'useaadauth' argument is passed, then the OBJECT_ID and IDENTIFIER_URI values are required as well.  Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
--arm-role-receivers

属于此操作组的 ARM 角色接收器列表。 角色是 Azure RBAC 角色,仅支持内置角色。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--automation-runbook-receivers

属于此操作组的 AutomationRunbook 接收器的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--azure-app-push-receivers

属于此操作组的 AzureAppPush 接收器列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--azure-function-receivers

属于此操作组的 Azure 函数接收器的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--email-receivers

属于此操作组的电子邮件接收方列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--enabled

指示是否启用此操作组。 如果未启用操作组,则其接收方不会接收通信。

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

属于此操作组的事件中心接收器的列表。 支持速记语法、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

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--incident-receivers

属于此操作组的事件接收器的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--itsm-receivers

属于此操作组的 ITSM 接收器的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--logic-app-receivers

属于此操作组的逻辑应用接收器列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--remove

从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.

--remove-action -r

从作组中删除接收方。 接受以空格分隔的接收方名称列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--set

通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>

--sms-receivers

属于此操作组的 SMS 接收器列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--tags

空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--voice-receivers

属于此操作组的语音接收器列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--webhook-receivers

属于此操作组的 Webhook 接收器列表。 支持速记语法、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

订阅的名称或 ID。 可以使用 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

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

--interval

轮询间隔(以秒为单位)。

默认值: 30
--name -n

作组的名称。 必填。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--subscription

订阅的名称或 ID。 可以使用 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

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。