Skip to content

Commit

Permalink
format the help markdown file of Az.AlertsManagement (#18376)
Browse files Browse the repository at this point in the history
* format the help markdown file of Az.AlertsManagement

* Update Set-AzAlertProcessingRule

* format the help markdown file of Az.AlertsManagement

* format the help markdown file of Az.AlertsManagement

Co-authored-by: Ziyue Zheng <v-ziyzhe@microsoft.com>
  • Loading branch information
CaptainFanZzz and ziyuezh576 authored Jun 22, 2022
1 parent a082c8d commit f620c6f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@ Get-AzAlertProcessingRule -Name <String> -ResourceGroupName <String> [-DefaultPr

### Example 1
```powershell
PS C:\> Get-AzAlertProcessingRule
Get-AzAlertProcessingRule
```

List all alert processing rules configured in subscription.

### Example 2
```powershell
PS C:\> Get-AzAlertProcessingRule -ResourceGroupName "test-rg"
Get-AzAlertProcessingRule -ResourceGroupName "test-rg"
```

List all alert processing rules configured in resource group test-rg.

### Example 3
```powershell
PS C:\> Get-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "Test-AlertProcessing-Rule" | Format-List
Get-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "Test-AlertProcessing-Rule" | Format-List
```

Get the alert processing rule with name Test-AlertProcessing-Rule in test-rg resource group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Remove-AzAlertProcessingRule -InputObject <PSActionRule> [-DefaultProfile <IAzur

### Example 1
```powershell
PS C:\> Remove-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "AlertProcessingRuleName"
Remove-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "AlertProcessingRuleName"
```

This cmdlet deletes the alert processing rule with name AlertProcessingRuleName in resource group test-rg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ Set-AzAlertProcessingRule -InputObject <PSAlertProcessingRule> [-DefaultProfile

### Example 1
```powershell
Set-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "AddActionGroupToSubscription" -Scope "/subscriptions/MySubscriptionId" -Description "Add ActionGroup1 to all alerts in the subscription" -Enabled "True" -AlertProcessingRuleType "AddActionGroups" -ActionGroupId "/subscriptions/MySubscriptionId/resourcegroups/MyResourceGroup1/providers/microsoft.insights/actiongroups/ActionGroup1"
Set-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "AddActionGroupToSubscription" -Scope "/subscriptions/MySubscriptionId" -Description "Add ActionGroup1 to all alerts in the subscription" -Enabled "True" -AlertProcessingRuleType "AddActionGroups" -ActionGroupId "/subscriptions/MySubscriptionId/resourcegroups/MyResourceGroup1/providers/microsoft.insights/actiongroups/ActionGroup1"
```

This cmdlet creates an alert processing rule that adds an action group to all alerts in a resource group.

### Example 2
```powershell
Set-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "AddActionGroupsBySeverity" -Scope "/subscriptions/MySubscriptionId" -Description "Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups" -Enabled "True" -AlertProcessingRuleType "AddActionGroups" -ActionGroupId "/subscriptions/MySubscriptionId/resourcegroups/MyResourceGroup1/providers/microsoft.insights/actiongroups/ActionGroup1,
/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup2/providers/microsoft.insights/actionGroups/MyActionGroup2" -MonitorServiceCondition "Equals:Sev0,Sev1"
Set-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "AddActionGroupsBySeverity" -Scope "/subscriptions/MySubscriptionId" -Description "Add AGId1 and AGId2 to all Sev0 and Sev1 alerts in these resourceGroups" -Enabled "True" -AlertProcessingRuleType "AddActionGroups" -ActionGroupId "/subscriptions/MySubscriptionId/resourcegroups/MyResourceGroup1/providers/microsoft.insights/actiongroups/ActionGroup1,/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup2/providers/microsoft.insights/actionGroups/MyActionGroup2" -FilterMonitorCondition "Equals:Sev0,Sev1"
```

This cmdlet creates a rule that adds two action groups to all Sev0 and Sev1 alerts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Update-AzAlertProcessingRule -InputObject <PSActionRule> [-Enabled <String>] [-T

### Example 1
```powershell
PS C:\> Update-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "Test-AlertProcessingRule" -Enabled "False"
Update-AzAlertProcessingRule -ResourceGroupName "test-rg" -Name "Test-AlertProcessingRule" -Enabled "False"
```

This cmdlet disables the alert processing rule.
Expand Down

0 comments on commit f620c6f

Please sign in to comment.