Microsoft.Insights metricAlerts 2018-03-01
The metricAlerts resource type can be deployed to: Resource groups.
To learn about resource group deployments, see Bicep or ARM template.
For a list of changed properties in each API version, see change log.
Remarks
For guidance on deploying monitoring solutions, see Create monitoring resources by using Bicep.
Template format
To create a Microsoft.Insights/metricAlerts resource, add the following Bicep or JSON to your template.
resource symbolicname 'Microsoft.Insights/metricAlerts@2018-03-01' = {
name: 'string'
location: 'string'
tags: {
tagName1: 'tagValue1'
tagName2: 'tagValue2'
}
properties: {
actions: [
{
actionGroupId: 'string'
webHookProperties: {}
}
]
autoMitigate: bool
criteria: {
'odata.type': 'string'
// For remaining properties, see MetricAlertCriteria objects
}
description: 'string'
enabled: bool
evaluationFrequency: 'string'
scopes: [
'string'
]
severity: int
targetResourceRegion: 'string'
targetResourceType: 'string'
windowSize: 'string'
}
}
MetricAlertCriteria objects
Set the odata.type property to specify the type of object.
For Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria, use:
'odata.type': 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
allOf: [
{
dimensions: [
{
name: 'string'
operator: 'string'
values: [
'string'
]
}
]
metricName: 'string'
metricNamespace: 'string'
name: 'string'
skipMetricValidation: bool
timeAggregation: 'string'
criterionType: 'string'
// For remaining properties, see MultiMetricCriteria objects
}
]
For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:
'odata.type': 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria'
allOf: [
{
criterionType: 'string'
dimensions: [
{
name: 'string'
operator: 'string'
values: [
'string'
]
}
]
metricName: 'string'
metricNamespace: 'string'
name: 'string'
operator: 'string'
skipMetricValidation: bool
threshold: int
timeAggregation: 'string'
}
]
For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:
'odata.type': 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria'
componentId: 'string'
failedLocationCount: int
webTestId: 'string'
MultiMetricCriteria objects
Set the criterionType property to specify the type of object.
For DynamicThresholdCriterion, use:
criterionType: 'DynamicThresholdCriterion'
alertSensitivity: 'string'
failingPeriods: {
minFailingPeriodsToAlert: int
numberOfEvaluationPeriods: int
}
ignoreDataBefore: 'string'
operator: 'string'
For StaticThresholdCriterion, use:
Property values
metricAlerts
| Name | Description | Value |
|---|---|---|
| type | The resource type For Bicep, set this value in the resource declaration. |
'Microsoft.Insights/metricAlerts' |
| apiVersion | The resource api version For Bicep, set this value in the resource declaration. |
'2018-03-01' |
| name | The resource name | string (required) Character limit: 1-260 Valid characters: Can't use: *#&+:<>?@%{}\/ or control characters Can't end with space or period. |
| location | Resource location | string (required) |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
| properties | The alert rule properties of the resource. | MetricAlertProperties (required) |
MetricAlertProperties
| Name | Description | Value |
|---|---|---|
| actions | the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. | MetricAlertAction[] |
| autoMitigate | the flag that indicates whether the alert should be auto resolved or not. The default is true. | bool |
| criteria | defines the specific alert criteria information. | MetricAlertCriteria (required) |
| description | the description of the metric alert that will be included in the alert email. | string |
| enabled | the flag that indicates whether the metric alert is enabled. | bool (required) |
| evaluationFrequency | how often the metric alert is evaluated represented in ISO 8601 duration format. | string (required) |
| scopes | the list of resource id's that this metric alert is scoped to. | string[] (required) |
| severity | Alert severity {0, 1, 2, 3, 4} | int (required) |
| targetResourceRegion | the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. | string |
| targetResourceType | the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. | string |
| windowSize | the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. | string (required) |
MetricAlertAction
| Name | Description | Value |
|---|---|---|
| actionGroupId | the id of the action group to use. | string |
| webHookProperties | This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook. | object |
MetricAlertCriteria
| Name | Description | Value |
|---|---|---|
| odata.type | Set the object type | Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria |
MetricAlertMultipleResourceMultipleMetricCriteria
| Name | Description | Value |
|---|---|---|
| odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' |
| allOf | the list of multiple metric criteria for this 'all of' operation. | MultiMetricCriteria[] |
MultiMetricCriteria
| Name | Description | Value |
|---|---|---|
| dimensions | List of dimension conditions. | MetricDimension[] |
| metricName | Name of the metric. | string (required) |
| metricNamespace | Namespace of the metric. | string |
| name | Name of the criteria. | string (required) |
| skipMetricValidation | Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. | bool |
| timeAggregation | the criteria time aggregation types. | 'Average' 'Count' 'Maximum' 'Minimum' 'Total' |
| criterionType | Set the object type | DynamicThresholdCriterion StaticThresholdCriterion |
MetricDimension
| Name | Description | Value |
|---|---|---|
| name | Name of the dimension. | string (required) |
| operator | the dimension operator. Only 'Include' and 'Exclude' are supported | string (required) |
| values | list of dimension values. | string[] (required) |
DynamicMetricCriteria
| Name | Description | Value |
|---|---|---|
| criterionType | Specifies the type of threshold criteria | 'DynamicThresholdCriterion' |
| alertSensitivity | The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. | 'High' 'Low' 'Medium' |
| failingPeriods | The minimum number of violations required within the selected lookback time window required to raise an alert. | DynamicThresholdFailingPeriods (required) |
| ignoreDataBefore | Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format) | string |
| operator | The operator used to compare the metric value against the threshold. | 'GreaterOrLessThan' 'GreaterThan' 'LessThan' |
DynamicThresholdFailingPeriods
| Name | Description | Value |
|---|---|---|
| minFailingPeriodsToAlert | The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. | int (required) |
| numberOfEvaluationPeriods | The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. | int (required) |
MetricCriteria
| Name | Description | Value |
|---|---|---|
| criterionType | Specifies the type of threshold criteria | 'DynamicThresholdCriterion' 'StaticThresholdCriterion' |
| dimensions | List of dimension conditions. | MetricDimension[] |
| metricName | Name of the metric. | string (required) |
| metricNamespace | Namespace of the metric. | string |
| name | Name of the criteria. | string (required) |
| operator | the criteria operator. | 'Equals' 'GreaterThan' 'GreaterThanOrEqual' 'LessThan' 'LessThanOrEqual' |
| skipMetricValidation | Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. | bool |
| threshold | the criteria threshold value that activates the alert. | int (required) |
| timeAggregation | the criteria time aggregation types. | 'Average' 'Count' 'Maximum' 'Minimum' 'Total' |
MetricAlertSingleResourceMultipleMetricCriteria
| Name | Description | Value |
|---|---|---|
| odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' |
| allOf | The list of metric criteria for this 'all of' operation. | MetricCriteria[] |
WebtestLocationAvailabilityCriteria
| Name | Description | Value |
|---|---|---|
| odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' |
| componentId | The Application Insights resource Id. | string (required) |
| failedLocationCount | The number of failed locations. | int (required) |
| webTestId | The Application Insights web test Id. | string (required) |
Quickstart templates
The following quickstart templates deploy this resource type.
| Template | Description |
|---|---|
| Scalable Umbraco CMS Web App |
This template provides a easy way to deploy umbraco CMS web app on Azure App Service Web Apps. |
| Create alerts for your Application Gateway |
Use these templates to easily create some important event alerts for your Azure Application Gateway. |
| Alert for Backend Last Byte Response metric. |
Use such templates to easily create some important event alerts for your Azure Application Gateway. |
| Alert for Unhealthy Host Count metric. |
Use such templates to easily create some important event alerts for your Azure Application Gateway. |
| Enterprise Governance-AppService, SQL DB, AD, OMS, Runbooks |
Cloud adoption for an Enterprise, small or large, require responsible and efficient governance models to derive value from their cloud deployments. CloudWise (a code-name for the solution), is a composite solution available from Azure Partner QuickStarts, is an adoption enabler for Customers, System Integrators and Partners alike, that delivers a self-serviceable, automated governance and operations solution, focused on Optimizing Your Costs, Improve Your Application(s) Reliability, Reducing Business Risk. The solution highlights the core governance pillars of Visibility and Control. |
| Dynamic Web Test Creation |
Create any number of App Insights web (ping) tests. |
| Deploy Application Insight and create alert in it |
This template allows you to deploy Application Insight and create alert in it |
| Metric alert rule with a dynamic threshold |
This template creates a metric alert rule that monitors the CPU Percentage metric of a virtual machine using a dynamic threshold condition type. |
| Metric alert rule with a static threshold |
This template creates a metric alert rule that monitors the CPU Percentage metric of a virtual machine using a static threshold condition type. |
| Metric alert rule for an availability test |
This template creates an Application Insights availability test along with a metric alert rule that monitors it. |