< Back

Get-AzureRmAlertRule

Tue Jan 29, 2019 9:48 pm

NAME Get-AzureRmAlertRule



SYNOPSIS

Gets alert rules.





SYNTAX

Get-AzureRmAlertRule [-DefaultProfile <IAzureContextContainer>] [-DetailedOutput] -Name <String> -ResourceGroupName <String> [<CommonParameters>]



Get-AzureRmAlertRule [-DefaultProfile <IAzureContextContainer>] [-DetailedOutput] -ResourceGroupName <String> -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.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DetailedOutput [<SwitchParameter>]

Displays full details in the output.



Required? false

Position? named

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Specifies the name of the alert rule to get.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceGroupName <String>

Specifies the name of the resource group.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-TargetResourceId <String>

Specifies the ID of the target resource.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

List<Microsoft.Azure.Commands.Insights.OutputClasses.PSAlertRule>







NOTES









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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... malertrule

Add-AzureRmLogAlertRule

Add-AzureRmMetricAlertRule

Add-AzureRmWebtestAlertRule

Get-AzureRmAlertHistory

Remove-AzureRmAlertRule