Add-​Azure​Rm​Webtest​Alert​Rule

Adds or updates a webtest alert rule.

Syntax

Add-AzureRmWebtestAlertRule
   -MetricName <String>
   -TargetResourceUri <String>
   -WindowSize <TimeSpan>
   -FailedLocationCount <Int32>
   [-MetricNamespace <String>]
   -Location <String>
   [-Description <String>]
   [-DisableRule]
   -ResourceGroup <String>
   -Name <String>
   [-Actions <System.Collections.Generic.List`1[Microsoft.Azure.Management.Insights.Models.RuleAction]>]
   [<CommonParameters>]

Description

The Add-AzureRmWebtestAlertRule cmdlet adds or updates an alert rule of either metric, event, or webtest type. The added rule is associated to a resource group and has a name.

Examples

Example 1: Add a webtest alert rule

PS C:\>Add-AzureRmWebtestAlertRule -Name "webtestRule" -Location "East US" -ResourceGroup "Default-Web-EastUS" -WindowSize 00:05:00 -MetricName "metric" -TargetResourceUri ":/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourcegroups/Default-Web-WestUS/providers/microsoft.insights/webtests/leowebtestr1-webtestr1" -Description "Nice Webtest rule" -Failed 3
RequestId                                                                                                    StatusCode
---------                                                                                                    ----------
9a5bc388-c7ac-4dc6-aa70-f4bc29c2c712                                                                                 OK

This command adds or updates a webtest alert rule.

Required Parameters

-FailedLocationCount

Specifies the failed location count for the webtest rules. This is similar to the threshold in the other types of rules.

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

Specifies the location where the rule is defined.

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

Specifies the name of the metric.

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

Specifies the name of the rule.

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

Specifies the name of the resource group.

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

Specifies the resource ID of the webtest.

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

Specifies the time window size for the rule to compute its data.

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

Optional Parameters

-Actions

Specifies a comma-separated list of actions.

Type:System.Collections.Generic.List`1[Microsoft.Azure.Management.Insights.Models.RuleAction]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Description

Specifies a description of the rule.

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

Disables the rule. If you do not specify this parameter, the rule is enabled.

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

Specifies the metric namespace for rule.

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