Get-AzureRmAlertRule

Gets alert rules.

Syntax

Get-AzureRmAlertRule -ResourceGroup <String> [-DetailedOutput] -Name <String> [<CommonParameters>]
Get-AzureRmAlertRule -ResourceGroup <String> [-DetailedOutput] -TargetResourceId <String> [<CommonParameters>]

Description

The Get-AzureRmAlertRule cmdlet gets an alert rule by its name or URI, or all alert rules from a specified resource group.

Examples

Example 1: Get alert rules for a resource group

PS C:\>Get-AzureRmAlertRule -ResourceGroup "Default-Web-CentralUS"

This command gets all of the alert rules for the resource group named Default-Web-CentralUS. The output does not contain details about the rules because the DetailedOutput parameter is not specified.

Example 2: Get an alert rule by name

PS C:\>Get-AzureRmAlertRule -ResourcGroup "Default-Web-CentralUS" -Name "myalert-7da64548-214d-42ca-b12b-b245bb8f0ac8"

This command gets the alert rule named myalert-7da64548-214d-42ca-b12b-b245bb8f0ac8. Because the DetailedOutput parameter is not specified, the output contains only basic information about the alert rule.

Example 3: Get an alert rule by name with detailed output

PS C:\>Get-AzureRmAlertRule -ResourceGroup "Default-Web-CentralUS" -Name "myalert-7da64548-214d-42ca-b12b-b245bb8f0ac8" -DetailedOutput

This command gets the alert rule named myalert-7da64548-214d-42ca-b12b-b245bb8f0ac8. The DetailedOutput parameter is specified, so the output is detailed.

Parameters

-ResourceGroup

Specifies the name of the resource group.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DetailedOutput

Displays full details in the output.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the alert rule to get.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-TargetResourceId

Specifies the ID of the target resource.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False