Skip to content

Commit 8407fbc

Browse files
committed
Adding new powershell commands for log alerts
1 parent e488307 commit 8407fbc

File tree

2 files changed

+14
-38
lines changed

2 files changed

+14
-38
lines changed

articles/azure-monitor/alerts/alerts-create-new-alert-rule.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ You can create a new alert rule using the [Azure CLI](/cli/azure/get-started-wit
303303
## Create a new alert rule using PowerShell
304304
305305
- To create a metric alert rule using PowerShell, use this cmdlet: [Add-AzMetricAlertRuleV2](/powershell/module/az.monitor/add-azmetricalertrulev2)
306+
- To create a log alert rule using PowerShell, use this cmdlet: [New-AzScheduledQueryRule](/powershell/module/az.monitor/new-azscheduledqueryrule?view=azps-9.0.1)
306307
- To create an activity log alert rule using PowerShell, use this cmdlet: [Set-AzActivityLogAlert](/powershell/module/az.monitor/set-azactivitylogalert)
307308
308309
## Create an activity log alert rule from the Activity log pane
@@ -450,7 +451,7 @@ The *sampleActivityLogAlert.parameters.json* file contains the values provided f
450451

451452
## Changes to log alert rule creation experience
452453

453-
If you're creating a new log alert rule, please note that current alert rule wizard is a little different from the earlier experience:
454+
If you're creating a new log alert rule, note that current alert rule wizard is a little different from the earlier experience:
454455

455456
- Previously, search results were included in the payload of the triggered alert and its associated notifications. The email included only 10 rows from the unfiltered results while the webhook payload contained 1000 unfiltered results. To get detailed context information about the alert so that you can decide on the appropriate action:
456457
- We recommend using [Dimensions](alerts-types.md#narrow-the-target-using-dimensions). Dimensions provide the column value that fired the alert, giving you context for why the alert fired and how to fix the issue.

articles/azure-monitor/alerts/alerts-manage-alert-rules.md

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -49,45 +49,20 @@ To enable recommended alert rules:
4949

5050
## Manage metric alert rules with the Azure CLI
5151

52-
This section describes how to do manage metric alert rules using the cross-platform [Azure CLI](/cli/azure/get-started-with-azure-cli). The following examples use [Azure Cloud Shell](../../cloud-shell/overview.md).
52+
This section describes how to manage metric alert rules using the cross-platform [Azure CLI](/cli/azure/get-started-with-azure-cli). The following examples use [Azure Cloud Shell](../../cloud-shell/overview.md).
5353

5454
1. In the [portal](https://portal.azure.com/), select **Cloud Shell**.
55-
56-
You can use commands with ``--help`` option to learn more about the command and how to use it. For example, the following command shows you the list of commands available for creating, viewing, and managing metric alerts.
57-
58-
```azurecli
59-
az monitor metrics alert --help
60-
```
61-
62-
### View all the metric alerts in a resource group
63-
64-
```azurecli
65-
az monitor metrics alert list -g {ResourceGroup}
66-
```
67-
68-
### See the details of a particular metric alert rule
69-
70-
Use the name or the resource ID of the rule in the following commands:
71-
72-
```azurecli
73-
az monitor metrics alert show -g {ResourceGroup} -n {AlertRuleName}
74-
```
75-
76-
```azurecli
77-
az monitor metrics alert show --ids {RuleResourceId}
78-
```
79-
80-
### Disable a metric alert rule
81-
82-
```azurecli
83-
az monitor metrics alert update -g {ResourceGroup} -n {AlertRuleName} --enabled false
84-
```
85-
86-
### Delete a metric alert rule
87-
88-
```azurecli
89-
az monitor metrics alert delete -g {ResourceGroup} -n {AlertRuleName}
90-
```
55+
1. Use these options of the `az monitor metrics alert` CLI command in this table:
56+
57+
58+
|Description |CLI command |
59+
|---------|---------|
60+
|View all the metric alerts in a resource group|```azurecli<br>az monitor metrics alert list -g {ResourceGroup}<br>```|
61+
|See the details of a particular metric alert rule|```azurecli<br>az monitor metrics alert show -g {ResourceGroup} -n {AlertRuleName}<br>``` |
62+
| |```azurecli<br>az monitor metrics alert show --ids {RuleResourceId}<br>`` |
63+
|Disable a metric alert rule|```azurecli<br>az monitor metrics alert update -g {ResourceGroup} -n {AlertRuleName} --enabled false<br>```|
64+
|Delete a metric alert rule|```azurecli<br>az monitor metrics alert update -g {ResourceGroup} -n {AlertRuleName} --enabled false<br>```|
65+
|Learn more about the command|```azurecli<br>az monitor metrics alert --help<br>``|
9166

9267
## Manage metric alert rules with PowerShell
9368

0 commit comments

Comments
 (0)