Share via


az monitor action-group

Manage action groups.

Commands

Name Description Type Status
az monitor action-group create

Create a new action group.

Core GA
az monitor action-group delete

Delete an action group.

Core GA
az monitor action-group enable-receiver

Enable a receiver in an action group.

Core GA
az monitor action-group identity

Manage identities of the action-group.

Core GA
az monitor action-group identity assign

Assign the user or system managed identities.

Core GA
az monitor action-group identity remove

Remove the user or system managed identities.

Core GA
az monitor action-group identity show

Show the details of managed identities.

Core GA
az monitor action-group list

List action groups under a resource group or the current subscription.

Core GA
az monitor action-group show

Show the details of an action group.

Core GA
az monitor action-group test-notifications

Manage action groups test-notifications.

Core GA
az monitor action-group test-notifications create

Create an action group test-notifications.

Core GA
az monitor action-group update

Update an action group.

Core GA
az monitor action-group wait

Place the CLI in a waiting state.

Core GA

az monitor action-group create

Create a new action group.

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]

Examples

Create a new action group

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

Required Parameters

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

The name of the action group.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--action --actions -a

Add receivers to the action group during the creation.

    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

The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--automation-runbook-receivers

The list of AutomationRunbook receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--azure-app-push-receivers

The list of AzureAppPush receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--azure-function-receivers

The list of azure function receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--email-receivers

The list of email receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--enabled

Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Default value: True
--event-hub-receivers

The list of event hub receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

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

The short name of the action group. This will be used in SMS messages.

--incident-receivers

The list of incident receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--itsm-receivers

The list of ITSM receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--___location -l

Location. Values from: az account list-locations. You can configure the default ___location using az configure --defaults ___location=<___location>. When not specified, the ___location of the resource group will be used.

Default value: Global
--logic-app-receivers

The list of logic app receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

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

Set the system managed identity.

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

Set the user managed identities. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--sms-receivers

The list of SMS receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use '' to clear existing tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--voice-receivers

The list of voice receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--webhook-receivers

The list of webhook receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor action-group delete

Delete an action group.

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

Optional Parameters

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

The name of the action group.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor action-group enable-receiver

Enable a receiver in an action group.

This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers.

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

Required Parameters

--name --receiver-name -n

The name of the receiver to resubscribe.

Optional Parameters

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

The name of the action group.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor action-group list

List action groups under a resource group or the current subscription.

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

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor action-group show

Show the details of an action group.

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

Examples

Show the details of an action group (commonly used with --output and --query).

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

Optional Parameters

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

The name of the action group.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor action-group update

Update an action group.

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]

Examples

Update an action group

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

Optional Parameters

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

The name of the action group.

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

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

Add receivers to the action group.

    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

The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--automation-runbook-receivers

The list of AutomationRunbook receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--azure-app-push-receivers

The list of AzureAppPush receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--azure-function-receivers

The list of azure function receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--email-receivers

The list of email receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--enabled

Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--event-hub-receivers

The list of event hub receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--group-short-name --short-name

The short name of the action group. This will be used in SMS messages.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--incident-receivers

The list of incident receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--itsm-receivers

The list of ITSM receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--logic-app-receivers

The list of logic app receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

--remove-action -r

Remove receivers from the action group. Accept space-separated list of receiver names. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

--sms-receivers

The list of SMS receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use '' to clear existing tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--voice-receivers

The list of voice receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--webhook-receivers

The list of webhook receivers that are part of this action group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az monitor action-group wait

Place the CLI in a waiting state.

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

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--interval

Polling interval in seconds.

Default value: 30
--name -n

The name of the action group. Required.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.