Share via


az monitor activity-log alert action-group

Commands

Name Description Type Status
az monitor activity-log alert action-group add

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

Core GA
az monitor activity-log alert action-group remove

Remove action groups from this activity log alert rule.

Core GA

az monitor activity-log alert action-group add

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

az monitor activity-log alert action-group add --action-group
                                               [--activity-log-alert-name --name]
                                               [--add]
                                               [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                               [--ids]
                                               [--remove]
                                               [--reset {0, 1, f, false, n, no, t, true, y, yes}]
                                               [--resource-group]
                                               [--set]
                                               [--strict {0, 1, f, false, n, no, t, true, y, yes}]
                                               [--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.insight
s/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/acti
onGroups/{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/acti
onGroups/{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. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--activity-log-alert-name --name -n

The name of the activity log alert.

Property Value
Parameter group: Resource Id Arguments
--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>.

Property Value
Parameter group: Generic Update Arguments
--force-string

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

Property Value
Parameter group: Generic Update Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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.

Property Value
Parameter group: Resource Id Arguments
--remove

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

Property Value
Parameter group: Generic Update Arguments
--reset

Remove all the existing action groups before add new conditions.

Property Value
Default value: False
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--set

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

Property Value
Parameter group: Generic Update Arguments
--strict

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

Property Value
Default value: False
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--subscription

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

Property Value
Parameter group: Resource Id Arguments
--webhook-properties -w

Space-separated webhook properties in 'key[=value]' format. These properties are associated with the action groups added in this command. For any webhook receiver in these action group, these data are appended to the webhook payload. To attach different webhook properties to different action groups, add the action groups in separate update-action commands. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az monitor activity-log alert action-group remove

Remove action groups from this activity log alert rule.

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

Required Parameters

--action-group -a

The names or the resource ids of the action groups to be added. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--activity-log-alert-name --name -n

The name of the activity log alert.

Property Value
Parameter group: Resource Id Arguments
--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>.

Property Value
Parameter group: Generic Update Arguments
--force-string

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

Property Value
Parameter group: Generic Update Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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.

Property Value
Parameter group: Resource Id Arguments
--remove

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

Property Value
Parameter group: Generic Update Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--set

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

Property Value
Parameter group: Generic Update Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False