az monitor activity-log alert action-group

Manage action groups for activity log alerts.

Commands

az monitor activity-log alert action-group add Add action groups to this activity log alert. It can also be used to overwrite existing webhook properties of particular action groups.
az monitor activity-log alert action-group remove Remove action groups from this activity log alert.

az monitor activity-log alert action-group add

Add action groups to this activity log alert. It can also be used to overwrite existing webhook properties of particular action groups.

az monitor activity-log alert action-group add --action-group
[--ids]
[--name]
[--reset]
[--resource-group]
[--strict]
[--subscription]
[--webhook-properties]

Examples

Add an action group and specify webhook properties.

az monitor activity-log alert action-group add -n {AlertName} -g {ResourceGroup} \
                          --action /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/microsoft.insights/actionGroups/{ActionGroup} \
                          --webhook-properties usage=test owner=jane

Overwite an existing action group's webhook properties.

az monitor activity-log alert action-group add -n {AlertName} -g {ResourceGroup} \
                          -a /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/microsoft.insights/actionGroups/{ActionGroup} \
                          --webhook-properties usage=test owner=john

Remove webhook properties from an existing action group.

az monitor activity-log alert action-group add -n {AlertName} -g {ResourceGroup} \
                          -a /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/microsoft.insights/actionGroups/{ActionGroup}

Add new action groups but prevent the command from accidently overwrite existing webhook properties

az monitor activity-log alert action-group add -n {AlertName} -g {ResourceGroup} --strict \
                          --action-group {ResourceIDList}

Required Parameters

--action-group -a

The names or the resource ids of the action groups to be added.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the activity log alerts.

--reset

Remove all the existing action groups before add new conditions.

--resource-group -g

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

--strict

Fails the command if an action group to be added will change existing webhook properties.

--subscription

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

--webhook-properties -w

Space-separated webhook properties in 'key[=value]' format. These properties will be associated with the action groups added in this command.

az monitor activity-log alert action-group remove

Remove action groups from this activity log alert.

az monitor activity-log alert action-group remove --action-group
[--ids]
[--name]
[--resource-group]
[--subscription]

Required Parameters

--action-group -a

The names or the resource ids of the action groups to be added.

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the activity log alerts.

--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.