Azure Metric Alerts Rule

Microsoft.SystemCenter.MicrosoftAzure.AlertsMonitor.Metric (Rule)

Description for the new alert rule.

Element properties:

TargetMicrosoft.SystemCenter.MicrosoftAzure.Insights.MetricAlert
CategoryAlert
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SystemCenter.MicrosoftAzure.Insights.MetricAlert.Monitoring.DS Microsoft.SystemCenter.MicrosoftAzure.RunAsProfile.Proxy
CD ConditionDetection System.ExpressionFilter Default
CloseAlert WriteAction Microsoft.SystemCenter.MicrosoftAzure.CloseMetricAlert Default
GenerateAlert WriteAction Microsoft.SystemCenter.MicrosoftAzure.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SystemCenter.MicrosoftAzure.AlertsMonitor.Metric" Target="Microsoft.SystemCenter.MicrosoftAzure.Insights.MetricAlert" Enabled="true" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Alert</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.SystemCenter.MicrosoftAzure.Insights.MetricAlert.Monitoring.DS" RunAs="Microsoft.SystemCenter.MicrosoftAzure.RunAsProfile.Proxy">
<ADUserName>$RunAs[Name="Microsoft.SystemCenter.MicrosoftAzure.RunAsProfile.ADCredentials"]/UserName$</ADUserName>
<ADPassword>$RunAs[Name="Microsoft.SystemCenter.MicrosoftAzure.RunAsProfile.ADCredentials"]/Password$</ADPassword>
<ADClientId>$Target/Host/Host/Property[Type="Microsoft.SystemCenter.MicrosoftAzure.Subscription"]/ClientId$</ADClientId>
<SubscriptionId>$Target/Host/Host/Property[Type="Microsoft.SystemCenter.MicrosoftAzure.Subscription"]/SubscriptionId$</SubscriptionId>
<Proxy>$Target/Host/Host/Property[Type="Microsoft.SystemCenter.MicrosoftAzure.Subscription"]/ProxyServerAddress$</Proxy>
<AuthBaseAddress>$Target/Host/Host/Property[Type="Microsoft.SystemCenter.MicrosoftAzure.Subscription"]/Authority$</AuthBaseAddress>
<ResourceBaseAddress>$Target/Host/Host/Property[Type="Microsoft.SystemCenter.MicrosoftAzure.Subscription"]/ArmServiceUri$</ResourceBaseAddress>
<Audience>$Target/Host/Host/Property[Type="Microsoft.SystemCenter.MicrosoftAzure.Subscription"]/ResourceUri$</Audience>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalSeconds>300</IntervalSeconds>
<TimeRange>720</TimeRange>
</DataSource>
</DataSources>
<ConditionDetection ID="CD" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='ResourceGroupName']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Target/Host/Property[Type="System!System.Entity"]/DisplayName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<Or>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='ResourceUri']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Target/Property[Type="Microsoft.SystemCenter.MicrosoftAzure.AzureServiceGeneric"]/ServiceId$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='RuleName']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Target/Property[Type="Microsoft.SystemCenter.MicrosoftAzure.AzureServiceGeneric"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Or>
</Expression>
</And>
</Expression>
</ConditionDetection>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Microsoft.SystemCenter.MicrosoftAzure.GenerateAlert">
<Priority>$Data/Property[@Name='Priority']$</Priority>
<Severity>$Data/Property[@Name='Severity']$</Severity>
</WriteAction>
<WriteAction ID="CloseAlert" TypeID="Microsoft.SystemCenter.MicrosoftAzure.CloseMetricAlert">
<TimeoutSeconds>300</TimeoutSeconds>
</WriteAction>
</WriteActions>
</Rule>