Add-​Alert​Rule

{{Fill in the Synopsis}}

Syntax

Add-AlertRule
   [-CustomEmails <String[]>]
   [-Description <String>]
   [-DisableRule]
   [-EmailAddress <String>]
   -EventName <String>
   -EventSource <String>
   -Level <String>
   -Location <String>
   -Name <String>
   -OperationName <String>
   -Operator <ConditionOperator>
   -ResourceGroup <String>
   -ResourceId <String>
   -ResourceProvider <String>
   -RuleType <AlertRuleTypes>
   [-SendToServiceOwners]
   -Status <String>
   -SubStatus <String>
   -Threshold <Double>
   [-WindowSize <TimeSpan>]
   [<CommonParameters>]
Add-AlertRule
   [-CustomEmails <String[]>]
   [-Description <String>]
   [-DisableRule]
   -FailedLocationCount <Int32>
   -Location <String>
   -Name <String>
   -ResourceGroup <String>
   -RuleType <AlertRuleTypes>
   [-SendToServiceOwners]
   [-WindowSize <TimeSpan>]
   [<CommonParameters>]
Add-AlertRule
   [-CustomEmails <String[]>]
   [-Description <String>]
   [-DisableRule]
   -Location <String>
   -MetricName <String>
   -Name <String>
   -Operator <ConditionOperator>
   -ResourceGroup <String>
   -ResourceId <String>
   -RuleType <AlertRuleTypes>
   [-SendToServiceOwners]
   -Threshold <Double>
   [-TimeAggregationOperator <TimeAggregationOperator>]
   [-WindowSize <TimeSpan>]
   [<CommonParameters>]

Description

{{Fill in the Description}}

Examples

Example 1

PS C:\> {{ Add example code here }}

{{ Add example description here }}

Required Parameters

-EventName

The event name for rule

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

The event source for rule

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

The failed location count for rule

Type:Int32
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Level

The level for rule

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

The Location name

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

The metric name for rule

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

The alert rule name

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

The operation name for rule

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

The rule condition operator

Type:ConditionOperator
Parameter Sets:GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroup

The resource group name

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

The resource id for rule

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

The resource provider for rule

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

The rule type

Type:AlertRuleTypes
Parameter Sets:Metric, Event, Webtest
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Status

The status for rule

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

The substatus for rule

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

The threshold for rule condition

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

Optional Parameters

-CustomEmails

The list of custom e-mails

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Description

The rule description

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

The disable rule (status) flag

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

The e-mail address for rule

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

The send to service owner flag

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

The time aggregation operator for rule

Type:TimeAggregationOperator
Parameter Sets:Average, Minimum, Maximum, Total, Last
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WindowSize

The window size for rule

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

Inputs

Microsoft.Azure.Management.Insights.Models.ConditionOperator

System.Double System.String System.Nullable`1[[Microsoft.Azure.Management.Insights.Models.TimeAggregationOperator, Microsoft.Azure.Insights, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]] System.Int32 Microsoft.Azure.Commands.Insights.Alerts.AlertRuleTypes System.Management.Automation.SwitchParameter System.TimeSpan System.String[]

Outputs

System.Collections.Generic.List`1[[System.Management.Automation.PSObject, System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]