You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/alerts/alerts-action-rules.md
+18-11Lines changed: 18 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,7 @@ In the fourth tab (**Details**), you give this rule a name, pick where it will b
124
124
125
125
### [Azure CLI](#tab/azure-cli)
126
126
127
-
You can use the Azure CLI to work with alert processing rules. See the `az monitor alert-processing-rules` page in the [Azure CLI docs](/cli/azure/monitor/alert-processing-rule) for detailed documentation and examples.
127
+
You can use the Azure CLI to work with alert processing rules. See the `az monitor alert-processing-rules`[page in the Azure CLI docs](/cli/azure/monitor/alert-processing-rule) for detailed documentation and examples.
128
128
129
129
### Prepare your environment
130
130
@@ -169,30 +169,37 @@ For example, to create a rule that adds an action group to all alerts in a subsc
--description "Add action group ag1 to all alerts in the subscription"
179
178
```
180
179
181
180
The [CLI documentation](/cli/azure/monitor/alert-processing-rule#az-monitor-alert-processing-rule-create) include more examples and an explanation of each parameter.
182
181
183
182
### [PowerShell](#tab/powershell)
184
183
184
+
You can use PowerShell to work with alert processing rules. See the `*-AzAlertProcessingRule` commands [in the PowerShell docs](/powershell/module/az.alertsmanagement) for detailed documentation and examples.
185
+
186
+
185
187
### Create an alert processing rule using PowerShell
186
188
187
189
Use the `Set-AzAlertProcessingRule` command to create alert processing rules.
188
190
For example, to create a rule that adds an action group to all alerts in a subscription, run:
189
191
190
192
```powershell
191
-
Set-AzAlertProcessingRule -ResourceGroupName rg1 -Name AddActionGroupToSubscription -Scope /subscriptions/MySubId -Description "Add action group ag1 to all alerts in the subscription" -AlertProcessingRuleType AddActionGroups -ActionGroupId /subscriptions/sub1/resourcegroups/rg1/providers/microsoft.insights/actiongroups/ag1
-Description "Add action group ag1 to all alerts in the subscription"
193
200
```
194
201
195
-
The [CLI documentation](/cli/azure/monitor/alert-processing-rule#az-monitor-alert-processing-rule-create) include more examples and an explanation of each parameter.
202
+
The [PowerShell documentation](/cli/azure/monitor/alert-processing-rule#az-monitor-alert-processing-rule-create) include more examples and an explanation of each parameter.
0 commit comments