Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Remarks
For guidance on deploying monitoring solutions, see Create monitoring resources by using Bicep.
Bicep resource definition
The metricAlerts resource type can be deployed with operations that target:
- Resource groups - See resource group deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Insights/metricAlerts resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Insights/metricAlerts@2018-03-01' = {
location: 'string'
name: 'string'
properties: {
actions: [
{
actionGroupId: 'string'
webHookProperties: {
{customized property}: 'string'
}
}
]
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'
}
tags: {
{customized property}: 'string'
}
}
MetricAlertCriteria objects
Set the odata.type property to specify the type of object.
For Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria, use:
{
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
}
]
odata.type: 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
}
For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:
{
allOf: [
{
criterionType: 'string'
dimensions: [
{
name: 'string'
operator: 'string'
values: [
'string'
]
}
]
metricName: 'string'
metricNamespace: 'string'
name: 'string'
operator: 'string'
skipMetricValidation: bool
threshold: int
timeAggregation: 'string'
}
]
odata.type: 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria'
}
For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:
{
componentId: 'string'
failedLocationCount: int
odata.type: 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria'
webTestId: 'string'
}
MultiMetricCriteria objects
Set the criterionType property to specify the type of object.
For DynamicThresholdCriterion, use:
{
alertSensitivity: 'string'
criterionType: 'DynamicThresholdCriterion'
failingPeriods: {
minFailingPeriodsToAlert: int
numberOfEvaluationPeriods: int
}
ignoreDataBefore: 'string'
operator: 'string'
}
For StaticThresholdCriterion, use:
{
criterionType: 'StaticThresholdCriterion'
operator: 'string'
threshold: int
}
Property Values
Microsoft.Insights/metricAlerts
Name | Description | Value |
---|---|---|
location | Resource location | string (required) |
name | The resource name | string (required) |
properties | The alert rule properties of the resource. | MetricAlertProperties (required) |
tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
DynamicMetricCriteria
Name | Description | Value |
---|---|---|
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' (required) |
criterionType | Specifies the type of threshold criteria | 'DynamicThresholdCriterion' (required) |
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' (required) |
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) |
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. | MetricAlertActionWebHookProperties |
MetricAlertActionWebHookProperties
Name | Description | Value |
---|
MetricAlertCriteria
Name | Description | Value |
---|---|---|
odata.type | Set to 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' for type MetricAlertMultipleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' for type MetricAlertSingleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' for type WebtestLocationAvailabilityCriteria. | 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required) |
MetricAlertMultipleResourceMultipleMetricCriteria
Name | Description | Value |
---|---|---|
allOf | the list of multiple metric criteria for this 'all of' operation. | MultiMetricCriteria[] |
odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (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. You cannot change the scope of a metric rule based on logs. | 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) |
MetricAlertSingleResourceMultipleMetricCriteria
Name | Description | Value |
---|---|---|
allOf | The list of metric criteria for this 'all of' operation. | MetricCriteria[] |
odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (required) |
MetricCriteria
Name | Description | Value |
---|---|---|
criterionType | Specifies the type of threshold criteria | 'DynamicThresholdCriterion' 'StaticThresholdCriterion' (required) |
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' (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 |
threshold | the criteria threshold value that activates the alert. | int (required) |
timeAggregation | the criteria time aggregation types. | 'Average' 'Count' 'Maximum' 'Minimum' 'Total' (required) |
MetricCriteria
Name | Description | Value |
---|---|---|
criterionType | Specifies the type of threshold criteria | 'StaticThresholdCriterion' (required) |
operator | the criteria operator. | 'Equals' 'GreaterThan' 'GreaterThanOrEqual' 'LessThan' 'LessThanOrEqual' (required) |
threshold | the criteria threshold value that activates the alert. | int (required) |
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) |
MultiMetricCriteria
Name | Description | Value |
---|---|---|
criterionType | Set to 'DynamicThresholdCriterion' for type DynamicMetricCriteria. Set to 'StaticThresholdCriterion' for type MetricCriteria. | 'DynamicThresholdCriterion' 'StaticThresholdCriterion' (required) |
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' (required) |
ResourceTags
Name | Description | Value |
---|
WebtestLocationAvailabilityCriteria
Name | Description | Value |
---|---|---|
componentId | The Application Insights resource Id. | string (required) |
failedLocationCount | The number of failed locations. | int (required) |
odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required) |
webTestId | The Application Insights web test Id. | string (required) |
Usage Examples
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
Module | Description |
---|---|
Metric Alert | AVM Resource Module for Metric Alert |
Azure Quickstart Samples
The following Azure Quickstart templates contain Bicep samples for deploying this resource type.
Bicep File | Description |
---|---|
Deploy Application Insight and create alert in it | This template allows you to deploy Application Insight and create alert in it |
ARM template resource definition
The metricAlerts resource type can be deployed with operations that target:
- Resource groups - See resource group deployment commands
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Insights/metricAlerts resource, add the following JSON to your template.
{
"type": "Microsoft.Insights/metricAlerts",
"apiVersion": "2018-03-01",
"name": "string",
"location": "string",
"properties": {
"actions": [
{
"actionGroupId": "string",
"webHookProperties": {
"{customized property}": "string"
}
}
],
"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"
},
"tags": {
"{customized property}": "string"
}
}
MetricAlertCriteria objects
Set the odata.type property to specify the type of object.
For Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria, use:
{
"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
} ],
"odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
}
For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:
{
"allOf": [
{
"criterionType": "string",
"dimensions": [
{
"name": "string",
"operator": "string",
"values": [ "string" ]
}
],
"metricName": "string",
"metricNamespace": "string",
"name": "string",
"operator": "string",
"skipMetricValidation": "bool",
"threshold": "int",
"timeAggregation": "string"
}
],
"odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"
}
For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:
{
"componentId": "string",
"failedLocationCount": "int",
"odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
"webTestId": "string"
}
MultiMetricCriteria objects
Set the criterionType property to specify the type of object.
For DynamicThresholdCriterion, use:
{
"alertSensitivity": "string",
"criterionType": "DynamicThresholdCriterion",
"failingPeriods": {
"minFailingPeriodsToAlert": "int",
"numberOfEvaluationPeriods": "int"
},
"ignoreDataBefore": "string",
"operator": "string"
}
For StaticThresholdCriterion, use:
{
"criterionType": "StaticThresholdCriterion",
"operator": "string",
"threshold": "int"
}
Property Values
Microsoft.Insights/metricAlerts
Name | Description | Value |
---|---|---|
apiVersion | The api version | '2018-03-01' |
location | Resource location | string (required) |
name | The resource name | string (required) |
properties | The alert rule properties of the resource. | MetricAlertProperties (required) |
tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
type | The resource type | 'Microsoft.Insights/metricAlerts' |
DynamicMetricCriteria
Name | Description | Value |
---|---|---|
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' (required) |
criterionType | Specifies the type of threshold criteria | 'DynamicThresholdCriterion' (required) |
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' (required) |
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) |
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. | MetricAlertActionWebHookProperties |
MetricAlertActionWebHookProperties
Name | Description | Value |
---|
MetricAlertCriteria
Name | Description | Value |
---|---|---|
odata.type | Set to 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' for type MetricAlertMultipleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' for type MetricAlertSingleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' for type WebtestLocationAvailabilityCriteria. | 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required) |
MetricAlertMultipleResourceMultipleMetricCriteria
Name | Description | Value |
---|---|---|
allOf | the list of multiple metric criteria for this 'all of' operation. | MultiMetricCriteria[] |
odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (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. You cannot change the scope of a metric rule based on logs. | 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) |
MetricAlertSingleResourceMultipleMetricCriteria
Name | Description | Value |
---|---|---|
allOf | The list of metric criteria for this 'all of' operation. | MetricCriteria[] |
odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (required) |
MetricCriteria
Name | Description | Value |
---|---|---|
criterionType | Specifies the type of threshold criteria | 'DynamicThresholdCriterion' 'StaticThresholdCriterion' (required) |
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' (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 |
threshold | the criteria threshold value that activates the alert. | int (required) |
timeAggregation | the criteria time aggregation types. | 'Average' 'Count' 'Maximum' 'Minimum' 'Total' (required) |
MetricCriteria
Name | Description | Value |
---|---|---|
criterionType | Specifies the type of threshold criteria | 'StaticThresholdCriterion' (required) |
operator | the criteria operator. | 'Equals' 'GreaterThan' 'GreaterThanOrEqual' 'LessThan' 'LessThanOrEqual' (required) |
threshold | the criteria threshold value that activates the alert. | int (required) |
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) |
MultiMetricCriteria
Name | Description | Value |
---|---|---|
criterionType | Set to 'DynamicThresholdCriterion' for type DynamicMetricCriteria. Set to 'StaticThresholdCriterion' for type MetricCriteria. | 'DynamicThresholdCriterion' 'StaticThresholdCriterion' (required) |
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' (required) |
ResourceTags
Name | Description | Value |
---|
WebtestLocationAvailabilityCriteria
Name | Description | Value |
---|---|---|
componentId | The Application Insights resource Id. | string (required) |
failedLocationCount | The number of failed locations. | int (required) |
odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required) |
webTestId | The Application Insights web test Id. | string (required) |
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
Template | Description |
---|---|
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. |
BrowserBox Azure Edition |
This template deploys BrowserBox on an Azure Ubuntu Server 22.04 LTS, Debian 11, or RHEL 8.7 LVM VM. |
Create alerts for your Application Gateway |
Use these templates to easily create some important event alerts for your Azure Application Gateway. |
Deploy Application Insight and create alert in it |
This template allows you to deploy Application Insight and create alert in it |
Dynamic Web Test Creation |
Create any number of App Insights web (ping) tests. |
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. |
Metric alert rule for an availability test |
This template creates an Application Insights availability test along with a metric alert rule that monitors 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. |
Scalable Umbraco CMS Web App |
This template provides a easy way to deploy umbraco CMS web app on Azure App Service Web Apps. |
Terraform (AzAPI provider) resource definition
The metricAlerts resource type can be deployed with operations that target:
- Resource groups
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Insights/metricAlerts resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Insights/metricAlerts@2018-03-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
actions = [
{
actionGroupId = "string"
webHookProperties = {
{customized property} = "string"
}
}
]
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:
{
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
}
]
odata.type = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
}
For Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria, use:
{
allOf = [
{
criterionType = "string"
dimensions = [
{
name = "string"
operator = "string"
values = [
"string"
]
}
]
metricName = "string"
metricNamespace = "string"
name = "string"
operator = "string"
skipMetricValidation = bool
threshold = int
timeAggregation = "string"
}
]
odata.type = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"
}
For Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria, use:
{
componentId = "string"
failedLocationCount = int
odata.type = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"
webTestId = "string"
}
MultiMetricCriteria objects
Set the criterionType property to specify the type of object.
For DynamicThresholdCriterion, use:
{
alertSensitivity = "string"
criterionType = "DynamicThresholdCriterion"
failingPeriods = {
minFailingPeriodsToAlert = int
numberOfEvaluationPeriods = int
}
ignoreDataBefore = "string"
operator = "string"
}
For StaticThresholdCriterion, use:
{
criterionType = "StaticThresholdCriterion"
operator = "string"
threshold = int
}
Property Values
Microsoft.Insights/metricAlerts
Name | Description | Value |
---|---|---|
location | Resource location | string (required) |
name | The resource name | string (required) |
properties | The alert rule properties of the resource. | MetricAlertProperties (required) |
tags | Resource tags | Dictionary of tag names and values. |
type | The resource type | "Microsoft.Insights/metricAlerts@2018-03-01" |
DynamicMetricCriteria
Name | Description | Value |
---|---|---|
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' (required) |
criterionType | Specifies the type of threshold criteria | 'DynamicThresholdCriterion' (required) |
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' (required) |
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) |
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. | MetricAlertActionWebHookProperties |
MetricAlertActionWebHookProperties
Name | Description | Value |
---|
MetricAlertCriteria
Name | Description | Value |
---|---|---|
odata.type | Set to 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' for type MetricAlertMultipleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' for type MetricAlertSingleResourceMultipleMetricCriteria. Set to 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' for type WebtestLocationAvailabilityCriteria. | 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required) |
MetricAlertMultipleResourceMultipleMetricCriteria
Name | Description | Value |
---|---|---|
allOf | the list of multiple metric criteria for this 'all of' operation. | MultiMetricCriteria[] |
odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (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. You cannot change the scope of a metric rule based on logs. | 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) |
MetricAlertSingleResourceMultipleMetricCriteria
Name | Description | Value |
---|---|---|
allOf | The list of metric criteria for this 'all of' operation. | MetricCriteria[] |
odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (required) |
MetricCriteria
Name | Description | Value |
---|---|---|
criterionType | Specifies the type of threshold criteria | 'DynamicThresholdCriterion' 'StaticThresholdCriterion' (required) |
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' (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 |
threshold | the criteria threshold value that activates the alert. | int (required) |
timeAggregation | the criteria time aggregation types. | 'Average' 'Count' 'Maximum' 'Minimum' 'Total' (required) |
MetricCriteria
Name | Description | Value |
---|---|---|
criterionType | Specifies the type of threshold criteria | 'StaticThresholdCriterion' (required) |
operator | the criteria operator. | 'Equals' 'GreaterThan' 'GreaterThanOrEqual' 'LessThan' 'LessThanOrEqual' (required) |
threshold | the criteria threshold value that activates the alert. | int (required) |
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) |
MultiMetricCriteria
Name | Description | Value |
---|---|---|
criterionType | Set to 'DynamicThresholdCriterion' for type DynamicMetricCriteria. Set to 'StaticThresholdCriterion' for type MetricCriteria. | 'DynamicThresholdCriterion' 'StaticThresholdCriterion' (required) |
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' (required) |
ResourceTags
Name | Description | Value |
---|
WebtestLocationAvailabilityCriteria
Name | Description | Value |
---|---|---|
componentId | The Application Insights resource Id. | string (required) |
failedLocationCount | The number of failed locations. | int (required) |
odata.type | specifies the type of the alert criteria. | 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (required) |
webTestId | The Application Insights web test Id. | string (required) |