Skip to content

Commit 6af1f1a

Browse files
authored
Merge pull request #188468 from ofirmanor/patch-5
Update alerts-action-rules.md
2 parents d52886a + 72fa32f commit 6af1f1a

File tree

1 file changed

+32
-54
lines changed

1 file changed

+32
-54
lines changed

articles/azure-monitor/alerts/alerts-action-rules.md

Lines changed: 32 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
title: Alert processing rules for Azure Monitor alerts
33
description: Understanding what alert processing rules in Azure Monitor are and how to configure and manage them.
44
ms.topic: conceptual
5-
ms.date: 11/11/2021
5+
ms.date: 02/02/2022
66

77
---
88

9-
# Alert processing rules (preview)
9+
# Alert processing rules
1010

1111
<a name="configuring-an-action-rule"></a>
1212
<a name="suppression-of-alerts"></a>
@@ -98,7 +98,7 @@ You may optionally control when will the rule apply. By default, the rule is app
9898
### [Portal](#tab/portal)
9999

100100
You can access alert processing rules by navigating to the **Alerts** home page in Azure Monitor.
101-
Once there, you can click **Alert processing rules (preview)** to see and manage your existing rules, or click **Create** --> **Alert processing rules (preview)** to open the new alert processing rule wizard.
101+
Once there, you can click **Alert processing rules** to see and manage your existing rules, or click **Create** --> **Alert processing rules** to open the new alert processing rule wizard.
102102

103103
![Accessing alert processing rules from the Azure Monitor landing page.](media/alerts-action-rules/action-rules-alerts-landing-page.png)
104104

@@ -124,80 +124,61 @@ In the fourth tab (**Details**), you give this rule a name, pick where it will b
124124

125125
### [Azure CLI](#tab/azure-cli)
126126

127-
> [!NOTE]
128-
> The Azure CLI is in the process of being updated to leverage the GA API of alert processing rules. Until then, you can use existing CLI capabilities under the **action rule** command to create alert processing rules. Meanwhile, the existing CLI does not support some of the newer alert processing rules features.
129-
130-
You can create alert processing rules with the Azure CLI using the [az monitor action-rule create](/cli/azure/monitor/action-rule#az_monitor_action_rule_create) command. The `az monitor action-rule` reference is just one of many [Azure CLI references for Azure Monitor](/cli/azure/azure-cli-reference-for-monitor).
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.
131128

132129
### Prepare your environment
133130

134-
1. [Install the Azure CLI](/cli/azure/install-azure-cli)
131+
1. **Install the Auzre CLI**
132+
133+
Follow the [Installation instructions for the Azure CLI](/cli/azure/install-azure-cli).
135134

136-
If you prefer, you can also use Azure Cloud Shell to complete the steps in this article. Azure Cloud Shell is an interactive shell environment that you use through your browser. Start Cloud Shell by using one of these methods:
135+
Alternatively, you can use Azure Cloud Shell, which is an interactive shell environment that you use through your browser. To start a Cloud Shell:
137136

138137
- Open Cloud Shell by going to [https://shell.azure.com](https://shell.azure.com)
139138

140139
- Select the **Cloud Shell** button on the menu bar at the upper right corner in the [Azure portal](https://portal.azure.com)
141140

142-
1. Sign in.
141+
1. **Sign in**
143142

144-
If you're using a local install of the CLI, sign in using the [az login](/cli/azure/reference-index#az_login) command. Follow the steps displayed in your terminal to complete the authentication process.
143+
If you're using a local installation of the CLI, sign in using the [az login](/cli/azure/reference-index#az-login) command. Follow the steps displayed in your terminal to complete the authentication process.
145144

146145
```azurecli
147146
az login
148147
```
149148
150-
1. Install the `alertsmanagement` extension
149+
1. **Install the `alertsmanagement` extension**
151150
152-
The `az monitor action-rule` command is an experimental extension of the core Azure CLI. Learn more about extension references in [Use extension with Azure CLI](/cli/azure/azure-cli-extensions-overview?).
151+
In order to use the `az monitor alert-processing-rule` commands, install the `alertsmanagement` preview extension.
153152
154153
```azurecli
155154
az extension add --name alertsmanagement
156155
```
157156

158-
The following warning is expected.
157+
The following output is expected.
159158

160159
```output
161-
The installed extension `alertsmanagement` is experimental and not covered by customer support. Please use with discretion.
160+
The installed extension 'alertsmanagement' is in preview.
162161
```
162+
163+
To learn more about Azure CLI extensions, check [Use extension with Azure CLI](/cli/azure/azure-cli-extensions-overview?).
163164

164165
### Create an alert processing rule with the Azure CLI
165166

166-
See the Azure CLI reference content for [az monitor action-rule create](/cli/azure/monitor/action-rule#az_monitor_action_rule_create) to learn about required and optional parameters.
167-
168-
Create an alert processing rule to suppress notifications in a resource group.
167+
Use the `az monitor alert-processing-rule create` command to create alert processing rules.
168+
For example, to create a rule that adds an action group to all alerts in a subscription, run:
169169

170170
```azurecli
171-
az monitor action-rule create --resource-group MyResourceGroupName \
172-
--name MyNewActionRuleName \
173-
--location Global \
174-
--status Enabled \
175-
--rule-type Suppression \
176-
--scope-type ResourceGroup \
177-
--scope /subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/MyResourceGroupName \
178-
--suppression-recurrence-type Always \
179-
--alert-context Contains Computer-01 \
180-
--monitor-service Equals "Log Analytics"
171+
az monitor alert-processing-rule create \
172+
--name 'AddActionGroupToSubscription' \
173+
--rule-type AddActionGroups \
174+
--scopes "/subscriptions/MySubscriptionId" \
175+
--action-groups "/subscriptions/MySubscriptionId/resourcegroups/MyResourceGroup1/providers/microsoft.insights/actiongroups/ActionGroup1" \
176+
--enabled true \
177+
--resource-group alertscorrelationrg \
178+
--description "Add ActionGroup1 to all alerts in the subscription"
181179
```
182180

183-
Create an alert processing rule to suppress notifications for all Sev4 alerts on all VMs within the subscription every weekend.
184-
185-
```azurecli
186-
az monitor action-rule create --resource-group MyResourceGroupName \
187-
--name MyNewActionRuleName \
188-
--location Global \
189-
--status Enabled \
190-
--rule-type Suppression \
191-
--severity Equals Sev4 \
192-
--target-resource-type Equals Microsoft.Compute/VirtualMachines \
193-
--suppression-recurrence-type Weekly \
194-
--suppression-recurrence 0 6 \
195-
--suppression-start-date 12/09/2018 \
196-
--suppression-end-date 12/18/2018 \
197-
--suppression-start-time 06:00:00 \
198-
--suppression-end-time 14:00:00
199-
200-
```
181+
The [CLI documentation](/cli/azure/monitor/alert-processing-rule#az-monitor-alert-processing-rule-create) include more examples and an explanation of each parameter.
201182

202183
* * *
203184

@@ -213,25 +194,22 @@ From here, you can enable, disable, or delete alert processing rules at scale by
213194

214195
### [Azure CLI](#tab/azure-cli)
215196

216-
> [!NOTE]
217-
> The Azure CLI is in the process of being updated to leverage the GA API of alert processing rules. Until then, you can use existing CLI capabilies under the **action rule** command to create alert processing rules. Meanwhile, the existing CLI does not support some of the newer alert processing rules features.
218-
219-
You can view and manage your alert processing rules using the [az monitor action-rule](/cli/azure/monitor) command from the Azure CLI.
197+
You can view and manage your alert processing rules using the [az monitor alert-processing-rules](/cli/azure/monitor/alert-processing-rule) commands from Azure CLI.
220198

221199
Before you manage alert processing rules with the Azure CLI, prepare your environment using the instructions provided in [Configuring an alert processing rule](#configuring-an-alert-processing-rule).
222200

223201
```azurecli
224202
# List all alert processing rules for a subscription
225-
az monitor action-rule list
203+
az monitor alert-processing-rules list
226204
227205
# Get details of an alert processing rule
228-
az monitor action-rule show --resource-group MyResourceGroupName --name MyActionRuleName
206+
az monitor alert-processing-rules show --resource-group MyResourceGroupName --name MyRule
229207
230208
# Update an alert processing rule
231-
az monitor action-rule update --resource-group MyResourceGroupName --name MyActionRuleName --status Disabled
209+
az monitor alert-processing-rules update --resource-group MyResourceGroupName --name MyRule --status Disabled
232210
233211
# Delete an alert processing rule
234-
az monitor action-rule delete --resource-group MyResourceGroupName --name MyActionRuleName
212+
az monitor alert-processing-rules delete --resource-group MyResourceGroupName --name MyRule
235213
```
236214

237215
* * *

0 commit comments

Comments
 (0)