We recommend using Azure Native.
azure.monitoring.MetricAlert
Explore with Pulumi AI
Manages a Metric Alert within Azure Monitor.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
    name: "example-resources",
    location: "West Europe",
});
const toMonitor = new azure.storage.Account("to_monitor", {
    name: "examplestorageaccount",
    resourceGroupName: example.name,
    location: example.location,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});
const main = new azure.monitoring.ActionGroup("main", {
    name: "example-actiongroup",
    resourceGroupName: example.name,
    shortName: "exampleact",
    webhookReceivers: [{
        name: "callmyapi",
        serviceUri: "http://example.com/alert",
    }],
});
const exampleMetricAlert = new azure.monitoring.MetricAlert("example", {
    name: "example-metricalert",
    resourceGroupName: example.name,
    scopes: [toMonitor.id],
    description: "Action will be triggered when Transactions count is greater than 50.",
    criterias: [{
        metricNamespace: "Microsoft.Storage/storageAccounts",
        metricName: "Transactions",
        aggregation: "Total",
        operator: "GreaterThan",
        threshold: 50,
        dimensions: [{
            name: "ApiName",
            operator: "Include",
            values: ["*"],
        }],
    }],
    actions: [{
        actionGroupId: main.id,
    }],
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
    name="example-resources",
    location="West Europe")
to_monitor = azure.storage.Account("to_monitor",
    name="examplestorageaccount",
    resource_group_name=example.name,
    location=example.location,
    account_tier="Standard",
    account_replication_type="LRS")
main = azure.monitoring.ActionGroup("main",
    name="example-actiongroup",
    resource_group_name=example.name,
    short_name="exampleact",
    webhook_receivers=[{
        "name": "callmyapi",
        "service_uri": "http://example.com/alert",
    }])
example_metric_alert = azure.monitoring.MetricAlert("example",
    name="example-metricalert",
    resource_group_name=example.name,
    scopes=[to_monitor.id],
    description="Action will be triggered when Transactions count is greater than 50.",
    criterias=[{
        "metric_namespace": "Microsoft.Storage/storageAccounts",
        "metric_name": "Transactions",
        "aggregation": "Total",
        "operator": "GreaterThan",
        "threshold": 50,
        "dimensions": [{
            "name": "ApiName",
            "operator": "Include",
            "values": ["*"],
        }],
    }],
    actions=[{
        "action_group_id": main.id,
    }])
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/monitoring"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("example-resources"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		toMonitor, err := storage.NewAccount(ctx, "to_monitor", &storage.AccountArgs{
			Name:                   pulumi.String("examplestorageaccount"),
			ResourceGroupName:      example.Name,
			Location:               example.Location,
			AccountTier:            pulumi.String("Standard"),
			AccountReplicationType: pulumi.String("LRS"),
		})
		if err != nil {
			return err
		}
		main, err := monitoring.NewActionGroup(ctx, "main", &monitoring.ActionGroupArgs{
			Name:              pulumi.String("example-actiongroup"),
			ResourceGroupName: example.Name,
			ShortName:         pulumi.String("exampleact"),
			WebhookReceivers: monitoring.ActionGroupWebhookReceiverArray{
				&monitoring.ActionGroupWebhookReceiverArgs{
					Name:       pulumi.String("callmyapi"),
					ServiceUri: pulumi.String("http://example.com/alert"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = monitoring.NewMetricAlert(ctx, "example", &monitoring.MetricAlertArgs{
			Name:              pulumi.String("example-metricalert"),
			ResourceGroupName: example.Name,
			Scopes: pulumi.StringArray{
				toMonitor.ID(),
			},
			Description: pulumi.String("Action will be triggered when Transactions count is greater than 50."),
			Criterias: monitoring.MetricAlertCriteriaArray{
				&monitoring.MetricAlertCriteriaArgs{
					MetricNamespace: pulumi.String("Microsoft.Storage/storageAccounts"),
					MetricName:      pulumi.String("Transactions"),
					Aggregation:     pulumi.String("Total"),
					Operator:        pulumi.String("GreaterThan"),
					Threshold:       pulumi.Float64(50),
					Dimensions: monitoring.MetricAlertCriteriaDimensionArray{
						&monitoring.MetricAlertCriteriaDimensionArgs{
							Name:     pulumi.String("ApiName"),
							Operator: pulumi.String("Include"),
							Values: pulumi.StringArray{
								pulumi.String("*"),
							},
						},
					},
				},
			},
			Actions: monitoring.MetricAlertActionArray{
				&monitoring.MetricAlertActionArgs{
					ActionGroupId: main.ID(),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "example-resources",
        Location = "West Europe",
    });
    var toMonitor = new Azure.Storage.Account("to_monitor", new()
    {
        Name = "examplestorageaccount",
        ResourceGroupName = example.Name,
        Location = example.Location,
        AccountTier = "Standard",
        AccountReplicationType = "LRS",
    });
    var main = new Azure.Monitoring.ActionGroup("main", new()
    {
        Name = "example-actiongroup",
        ResourceGroupName = example.Name,
        ShortName = "exampleact",
        WebhookReceivers = new[]
        {
            new Azure.Monitoring.Inputs.ActionGroupWebhookReceiverArgs
            {
                Name = "callmyapi",
                ServiceUri = "http://example.com/alert",
            },
        },
    });
    var exampleMetricAlert = new Azure.Monitoring.MetricAlert("example", new()
    {
        Name = "example-metricalert",
        ResourceGroupName = example.Name,
        Scopes = new[]
        {
            toMonitor.Id,
        },
        Description = "Action will be triggered when Transactions count is greater than 50.",
        Criterias = new[]
        {
            new Azure.Monitoring.Inputs.MetricAlertCriteriaArgs
            {
                MetricNamespace = "Microsoft.Storage/storageAccounts",
                MetricName = "Transactions",
                Aggregation = "Total",
                Operator = "GreaterThan",
                Threshold = 50,
                Dimensions = new[]
                {
                    new Azure.Monitoring.Inputs.MetricAlertCriteriaDimensionArgs
                    {
                        Name = "ApiName",
                        Operator = "Include",
                        Values = new[]
                        {
                            "*",
                        },
                    },
                },
            },
        },
        Actions = new[]
        {
            new Azure.Monitoring.Inputs.MetricAlertActionArgs
            {
                ActionGroupId = main.Id,
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.monitoring.ActionGroup;
import com.pulumi.azure.monitoring.ActionGroupArgs;
import com.pulumi.azure.monitoring.inputs.ActionGroupWebhookReceiverArgs;
import com.pulumi.azure.monitoring.MetricAlert;
import com.pulumi.azure.monitoring.MetricAlertArgs;
import com.pulumi.azure.monitoring.inputs.MetricAlertCriteriaArgs;
import com.pulumi.azure.monitoring.inputs.MetricAlertActionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        var example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name("example-resources")
            .location("West Europe")
            .build());
        var toMonitor = new Account("toMonitor", AccountArgs.builder()
            .name("examplestorageaccount")
            .resourceGroupName(example.name())
            .location(example.location())
            .accountTier("Standard")
            .accountReplicationType("LRS")
            .build());
        var main = new ActionGroup("main", ActionGroupArgs.builder()
            .name("example-actiongroup")
            .resourceGroupName(example.name())
            .shortName("exampleact")
            .webhookReceivers(ActionGroupWebhookReceiverArgs.builder()
                .name("callmyapi")
                .serviceUri("http://example.com/alert")
                .build())
            .build());
        var exampleMetricAlert = new MetricAlert("exampleMetricAlert", MetricAlertArgs.builder()
            .name("example-metricalert")
            .resourceGroupName(example.name())
            .scopes(toMonitor.id())
            .description("Action will be triggered when Transactions count is greater than 50.")
            .criterias(MetricAlertCriteriaArgs.builder()
                .metricNamespace("Microsoft.Storage/storageAccounts")
                .metricName("Transactions")
                .aggregation("Total")
                .operator("GreaterThan")
                .threshold(50)
                .dimensions(MetricAlertCriteriaDimensionArgs.builder()
                    .name("ApiName")
                    .operator("Include")
                    .values("*")
                    .build())
                .build())
            .actions(MetricAlertActionArgs.builder()
                .actionGroupId(main.id())
                .build())
            .build());
    }
}
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: example-resources
      location: West Europe
  toMonitor:
    type: azure:storage:Account
    name: to_monitor
    properties:
      name: examplestorageaccount
      resourceGroupName: ${example.name}
      location: ${example.location}
      accountTier: Standard
      accountReplicationType: LRS
  main:
    type: azure:monitoring:ActionGroup
    properties:
      name: example-actiongroup
      resourceGroupName: ${example.name}
      shortName: exampleact
      webhookReceivers:
        - name: callmyapi
          serviceUri: http://example.com/alert
  exampleMetricAlert:
    type: azure:monitoring:MetricAlert
    name: example
    properties:
      name: example-metricalert
      resourceGroupName: ${example.name}
      scopes:
        - ${toMonitor.id}
      description: Action will be triggered when Transactions count is greater than 50.
      criterias:
        - metricNamespace: Microsoft.Storage/storageAccounts
          metricName: Transactions
          aggregation: Total
          operator: GreaterThan
          threshold: 50
          dimensions:
            - name: ApiName
              operator: Include
              values:
                - '*'
      actions:
        - actionGroupId: ${main.id}
Create MetricAlert Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MetricAlert(name: string, args: MetricAlertArgs, opts?: CustomResourceOptions);@overload
def MetricAlert(resource_name: str,
                args: MetricAlertArgs,
                opts: Optional[ResourceOptions] = None)
@overload
def MetricAlert(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                resource_group_name: Optional[str] = None,
                scopes: Optional[Sequence[str]] = None,
                name: Optional[str] = None,
                auto_mitigate: Optional[bool] = None,
                description: Optional[str] = None,
                dynamic_criteria: Optional[MetricAlertDynamicCriteriaArgs] = None,
                enabled: Optional[bool] = None,
                frequency: Optional[str] = None,
                actions: Optional[Sequence[MetricAlertActionArgs]] = None,
                criterias: Optional[Sequence[MetricAlertCriteriaArgs]] = None,
                application_insights_web_test_location_availability_criteria: Optional[MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs] = None,
                severity: Optional[int] = None,
                tags: Optional[Mapping[str, str]] = None,
                target_resource_location: Optional[str] = None,
                target_resource_type: Optional[str] = None,
                window_size: Optional[str] = None)func NewMetricAlert(ctx *Context, name string, args MetricAlertArgs, opts ...ResourceOption) (*MetricAlert, error)public MetricAlert(string name, MetricAlertArgs args, CustomResourceOptions? opts = null)
public MetricAlert(String name, MetricAlertArgs args)
public MetricAlert(String name, MetricAlertArgs args, CustomResourceOptions options)
type: azure:monitoring:MetricAlert
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args MetricAlertArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args MetricAlertArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args MetricAlertArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MetricAlertArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MetricAlertArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var metricAlertResource = new Azure.Monitoring.MetricAlert("metricAlertResource", new()
{
    ResourceGroupName = "string",
    Scopes = new[]
    {
        "string",
    },
    Name = "string",
    AutoMitigate = false,
    Description = "string",
    DynamicCriteria = new Azure.Monitoring.Inputs.MetricAlertDynamicCriteriaArgs
    {
        Aggregation = "string",
        AlertSensitivity = "string",
        MetricName = "string",
        MetricNamespace = "string",
        Operator = "string",
        Dimensions = new[]
        {
            new Azure.Monitoring.Inputs.MetricAlertDynamicCriteriaDimensionArgs
            {
                Name = "string",
                Operator = "string",
                Values = new[]
                {
                    "string",
                },
            },
        },
        EvaluationFailureCount = 0,
        EvaluationTotalCount = 0,
        IgnoreDataBefore = "string",
        SkipMetricValidation = false,
    },
    Enabled = false,
    Frequency = "string",
    Actions = new[]
    {
        new Azure.Monitoring.Inputs.MetricAlertActionArgs
        {
            ActionGroupId = "string",
            WebhookProperties = 
            {
                { "string", "string" },
            },
        },
    },
    Criterias = new[]
    {
        new Azure.Monitoring.Inputs.MetricAlertCriteriaArgs
        {
            Aggregation = "string",
            MetricName = "string",
            MetricNamespace = "string",
            Operator = "string",
            Threshold = 0,
            Dimensions = new[]
            {
                new Azure.Monitoring.Inputs.MetricAlertCriteriaDimensionArgs
                {
                    Name = "string",
                    Operator = "string",
                    Values = new[]
                    {
                        "string",
                    },
                },
            },
            SkipMetricValidation = false,
        },
    },
    ApplicationInsightsWebTestLocationAvailabilityCriteria = new Azure.Monitoring.Inputs.MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs
    {
        ComponentId = "string",
        FailedLocationCount = 0,
        WebTestId = "string",
    },
    Severity = 0,
    Tags = 
    {
        { "string", "string" },
    },
    TargetResourceLocation = "string",
    TargetResourceType = "string",
    WindowSize = "string",
});
example, err := monitoring.NewMetricAlert(ctx, "metricAlertResource", &monitoring.MetricAlertArgs{
	ResourceGroupName: pulumi.String("string"),
	Scopes: pulumi.StringArray{
		pulumi.String("string"),
	},
	Name:         pulumi.String("string"),
	AutoMitigate: pulumi.Bool(false),
	Description:  pulumi.String("string"),
	DynamicCriteria: &monitoring.MetricAlertDynamicCriteriaArgs{
		Aggregation:      pulumi.String("string"),
		AlertSensitivity: pulumi.String("string"),
		MetricName:       pulumi.String("string"),
		MetricNamespace:  pulumi.String("string"),
		Operator:         pulumi.String("string"),
		Dimensions: monitoring.MetricAlertDynamicCriteriaDimensionArray{
			&monitoring.MetricAlertDynamicCriteriaDimensionArgs{
				Name:     pulumi.String("string"),
				Operator: pulumi.String("string"),
				Values: pulumi.StringArray{
					pulumi.String("string"),
				},
			},
		},
		EvaluationFailureCount: pulumi.Int(0),
		EvaluationTotalCount:   pulumi.Int(0),
		IgnoreDataBefore:       pulumi.String("string"),
		SkipMetricValidation:   pulumi.Bool(false),
	},
	Enabled:   pulumi.Bool(false),
	Frequency: pulumi.String("string"),
	Actions: monitoring.MetricAlertActionArray{
		&monitoring.MetricAlertActionArgs{
			ActionGroupId: pulumi.String("string"),
			WebhookProperties: pulumi.StringMap{
				"string": pulumi.String("string"),
			},
		},
	},
	Criterias: monitoring.MetricAlertCriteriaArray{
		&monitoring.MetricAlertCriteriaArgs{
			Aggregation:     pulumi.String("string"),
			MetricName:      pulumi.String("string"),
			MetricNamespace: pulumi.String("string"),
			Operator:        pulumi.String("string"),
			Threshold:       pulumi.Float64(0),
			Dimensions: monitoring.MetricAlertCriteriaDimensionArray{
				&monitoring.MetricAlertCriteriaDimensionArgs{
					Name:     pulumi.String("string"),
					Operator: pulumi.String("string"),
					Values: pulumi.StringArray{
						pulumi.String("string"),
					},
				},
			},
			SkipMetricValidation: pulumi.Bool(false),
		},
	},
	ApplicationInsightsWebTestLocationAvailabilityCriteria: &monitoring.MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs{
		ComponentId:         pulumi.String("string"),
		FailedLocationCount: pulumi.Int(0),
		WebTestId:           pulumi.String("string"),
	},
	Severity: pulumi.Int(0),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	TargetResourceLocation: pulumi.String("string"),
	TargetResourceType:     pulumi.String("string"),
	WindowSize:             pulumi.String("string"),
})
var metricAlertResource = new MetricAlert("metricAlertResource", MetricAlertArgs.builder()
    .resourceGroupName("string")
    .scopes("string")
    .name("string")
    .autoMitigate(false)
    .description("string")
    .dynamicCriteria(MetricAlertDynamicCriteriaArgs.builder()
        .aggregation("string")
        .alertSensitivity("string")
        .metricName("string")
        .metricNamespace("string")
        .operator("string")
        .dimensions(MetricAlertDynamicCriteriaDimensionArgs.builder()
            .name("string")
            .operator("string")
            .values("string")
            .build())
        .evaluationFailureCount(0)
        .evaluationTotalCount(0)
        .ignoreDataBefore("string")
        .skipMetricValidation(false)
        .build())
    .enabled(false)
    .frequency("string")
    .actions(MetricAlertActionArgs.builder()
        .actionGroupId("string")
        .webhookProperties(Map.of("string", "string"))
        .build())
    .criterias(MetricAlertCriteriaArgs.builder()
        .aggregation("string")
        .metricName("string")
        .metricNamespace("string")
        .operator("string")
        .threshold(0)
        .dimensions(MetricAlertCriteriaDimensionArgs.builder()
            .name("string")
            .operator("string")
            .values("string")
            .build())
        .skipMetricValidation(false)
        .build())
    .applicationInsightsWebTestLocationAvailabilityCriteria(MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs.builder()
        .componentId("string")
        .failedLocationCount(0)
        .webTestId("string")
        .build())
    .severity(0)
    .tags(Map.of("string", "string"))
    .targetResourceLocation("string")
    .targetResourceType("string")
    .windowSize("string")
    .build());
metric_alert_resource = azure.monitoring.MetricAlert("metricAlertResource",
    resource_group_name="string",
    scopes=["string"],
    name="string",
    auto_mitigate=False,
    description="string",
    dynamic_criteria={
        "aggregation": "string",
        "alert_sensitivity": "string",
        "metric_name": "string",
        "metric_namespace": "string",
        "operator": "string",
        "dimensions": [{
            "name": "string",
            "operator": "string",
            "values": ["string"],
        }],
        "evaluation_failure_count": 0,
        "evaluation_total_count": 0,
        "ignore_data_before": "string",
        "skip_metric_validation": False,
    },
    enabled=False,
    frequency="string",
    actions=[{
        "action_group_id": "string",
        "webhook_properties": {
            "string": "string",
        },
    }],
    criterias=[{
        "aggregation": "string",
        "metric_name": "string",
        "metric_namespace": "string",
        "operator": "string",
        "threshold": 0,
        "dimensions": [{
            "name": "string",
            "operator": "string",
            "values": ["string"],
        }],
        "skip_metric_validation": False,
    }],
    application_insights_web_test_location_availability_criteria={
        "component_id": "string",
        "failed_location_count": 0,
        "web_test_id": "string",
    },
    severity=0,
    tags={
        "string": "string",
    },
    target_resource_location="string",
    target_resource_type="string",
    window_size="string")
const metricAlertResource = new azure.monitoring.MetricAlert("metricAlertResource", {
    resourceGroupName: "string",
    scopes: ["string"],
    name: "string",
    autoMitigate: false,
    description: "string",
    dynamicCriteria: {
        aggregation: "string",
        alertSensitivity: "string",
        metricName: "string",
        metricNamespace: "string",
        operator: "string",
        dimensions: [{
            name: "string",
            operator: "string",
            values: ["string"],
        }],
        evaluationFailureCount: 0,
        evaluationTotalCount: 0,
        ignoreDataBefore: "string",
        skipMetricValidation: false,
    },
    enabled: false,
    frequency: "string",
    actions: [{
        actionGroupId: "string",
        webhookProperties: {
            string: "string",
        },
    }],
    criterias: [{
        aggregation: "string",
        metricName: "string",
        metricNamespace: "string",
        operator: "string",
        threshold: 0,
        dimensions: [{
            name: "string",
            operator: "string",
            values: ["string"],
        }],
        skipMetricValidation: false,
    }],
    applicationInsightsWebTestLocationAvailabilityCriteria: {
        componentId: "string",
        failedLocationCount: 0,
        webTestId: "string",
    },
    severity: 0,
    tags: {
        string: "string",
    },
    targetResourceLocation: "string",
    targetResourceType: "string",
    windowSize: "string",
});
type: azure:monitoring:MetricAlert
properties:
    actions:
        - actionGroupId: string
          webhookProperties:
            string: string
    applicationInsightsWebTestLocationAvailabilityCriteria:
        componentId: string
        failedLocationCount: 0
        webTestId: string
    autoMitigate: false
    criterias:
        - aggregation: string
          dimensions:
            - name: string
              operator: string
              values:
                - string
          metricName: string
          metricNamespace: string
          operator: string
          skipMetricValidation: false
          threshold: 0
    description: string
    dynamicCriteria:
        aggregation: string
        alertSensitivity: string
        dimensions:
            - name: string
              operator: string
              values:
                - string
        evaluationFailureCount: 0
        evaluationTotalCount: 0
        ignoreDataBefore: string
        metricName: string
        metricNamespace: string
        operator: string
        skipMetricValidation: false
    enabled: false
    frequency: string
    name: string
    resourceGroupName: string
    scopes:
        - string
    severity: 0
    tags:
        string: string
    targetResourceLocation: string
    targetResourceType: string
    windowSize: string
MetricAlert Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MetricAlert resource accepts the following input properties:
- ResourceGroup stringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- Scopes List<string>
- A set of strings of resource IDs at which the metric criteria should be applied.
- Actions
List<MetricAlert Action> 
- One or more actionblocks as defined below.
- 
MetricAlert Application Insights Web Test Location Availability Criteria 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- AutoMitigate bool
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- Criterias
List<MetricAlert Criteria> 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- Description string
- The description of this Metric Alert.
- DynamicCriteria MetricAlert Dynamic Criteria 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- Enabled bool
- Should this Metric Alert be enabled? Defaults to true.
- Frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- Name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- Severity int
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- TargetResource stringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- TargetResource stringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- WindowSize string
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- ResourceGroup stringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- Scopes []string
- A set of strings of resource IDs at which the metric criteria should be applied.
- Actions
[]MetricAlert Action Args 
- One or more actionblocks as defined below.
- 
MetricAlert Application Insights Web Test Location Availability Criteria Args 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- AutoMitigate bool
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- Criterias
[]MetricAlert Criteria Args 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- Description string
- The description of this Metric Alert.
- DynamicCriteria MetricAlert Dynamic Criteria Args 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- Enabled bool
- Should this Metric Alert be enabled? Defaults to true.
- Frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- Name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- Severity int
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- map[string]string
- A mapping of tags to assign to the resource.
- TargetResource stringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- TargetResource stringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- WindowSize string
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- resourceGroup StringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes List<String>
- A set of strings of resource IDs at which the metric criteria should be applied.
- actions
List<MetricAlert Action> 
- One or more actionblocks as defined below.
- 
MetricAlert Application Insights Web Test Location Availability Criteria 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- autoMitigate Boolean
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- criterias
List<MetricAlert Criteria> 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- description String
- The description of this Metric Alert.
- dynamicCriteria MetricAlert Dynamic Criteria 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- enabled Boolean
- Should this Metric Alert be enabled? Defaults to true.
- frequency String
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- name String
- The name of the Metric Alert. Changing this forces a new resource to be created.
- severity Integer
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- Map<String,String>
- A mapping of tags to assign to the resource.
- targetResource StringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- targetResource StringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- windowSize String
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- resourceGroup stringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes string[]
- A set of strings of resource IDs at which the metric criteria should be applied.
- actions
MetricAlert Action[] 
- One or more actionblocks as defined below.
- 
MetricAlert Application Insights Web Test Location Availability Criteria 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- autoMitigate boolean
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- criterias
MetricAlert Criteria[] 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- description string
- The description of this Metric Alert.
- dynamicCriteria MetricAlert Dynamic Criteria 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- enabled boolean
- Should this Metric Alert be enabled? Defaults to true.
- frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- severity number
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- targetResource stringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- targetResource stringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- windowSize string
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- resource_group_ strname 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes Sequence[str]
- A set of strings of resource IDs at which the metric criteria should be applied.
- actions
Sequence[MetricAlert Action Args] 
- One or more actionblocks as defined below.
- application_insights_ Metricweb_ test_ location_ availability_ criteria Alert Application Insights Web Test Location Availability Criteria Args 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- auto_mitigate bool
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- criterias
Sequence[MetricAlert Criteria Args] 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- description str
- The description of this Metric Alert.
- dynamic_criteria MetricAlert Dynamic Criteria Args 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- enabled bool
- Should this Metric Alert be enabled? Defaults to true.
- frequency str
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- name str
- The name of the Metric Alert. Changing this forces a new resource to be created.
- severity int
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- target_resource_ strlocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- target_resource_ strtype 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- window_size str
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- resourceGroup StringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes List<String>
- A set of strings of resource IDs at which the metric criteria should be applied.
- actions List<Property Map>
- One or more actionblocks as defined below.
- Property Map
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- autoMitigate Boolean
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- criterias List<Property Map>
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- description String
- The description of this Metric Alert.
- dynamicCriteria Property Map
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- enabled Boolean
- Should this Metric Alert be enabled? Defaults to true.
- frequency String
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- name String
- The name of the Metric Alert. Changing this forces a new resource to be created.
- severity Number
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- Map<String>
- A mapping of tags to assign to the resource.
- targetResource StringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- targetResource StringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- windowSize String
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
Outputs
All input properties are implicitly available as output properties. Additionally, the MetricAlert resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing MetricAlert Resource
Get an existing MetricAlert resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: MetricAlertState, opts?: CustomResourceOptions): MetricAlert@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        actions: Optional[Sequence[MetricAlertActionArgs]] = None,
        application_insights_web_test_location_availability_criteria: Optional[MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs] = None,
        auto_mitigate: Optional[bool] = None,
        criterias: Optional[Sequence[MetricAlertCriteriaArgs]] = None,
        description: Optional[str] = None,
        dynamic_criteria: Optional[MetricAlertDynamicCriteriaArgs] = None,
        enabled: Optional[bool] = None,
        frequency: Optional[str] = None,
        name: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        scopes: Optional[Sequence[str]] = None,
        severity: Optional[int] = None,
        tags: Optional[Mapping[str, str]] = None,
        target_resource_location: Optional[str] = None,
        target_resource_type: Optional[str] = None,
        window_size: Optional[str] = None) -> MetricAlertfunc GetMetricAlert(ctx *Context, name string, id IDInput, state *MetricAlertState, opts ...ResourceOption) (*MetricAlert, error)public static MetricAlert Get(string name, Input<string> id, MetricAlertState? state, CustomResourceOptions? opts = null)public static MetricAlert get(String name, Output<String> id, MetricAlertState state, CustomResourceOptions options)resources:  _:    type: azure:monitoring:MetricAlert    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Actions
List<MetricAlert Action> 
- One or more actionblocks as defined below.
- 
MetricAlert Application Insights Web Test Location Availability Criteria 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- AutoMitigate bool
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- Criterias
List<MetricAlert Criteria> 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- Description string
- The description of this Metric Alert.
- DynamicCriteria MetricAlert Dynamic Criteria 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- Enabled bool
- Should this Metric Alert be enabled? Defaults to true.
- Frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- Name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- ResourceGroup stringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- Scopes List<string>
- A set of strings of resource IDs at which the metric criteria should be applied.
- Severity int
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- TargetResource stringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- TargetResource stringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- WindowSize string
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- Actions
[]MetricAlert Action Args 
- One or more actionblocks as defined below.
- 
MetricAlert Application Insights Web Test Location Availability Criteria Args 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- AutoMitigate bool
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- Criterias
[]MetricAlert Criteria Args 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- Description string
- The description of this Metric Alert.
- DynamicCriteria MetricAlert Dynamic Criteria Args 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- Enabled bool
- Should this Metric Alert be enabled? Defaults to true.
- Frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- Name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- ResourceGroup stringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- Scopes []string
- A set of strings of resource IDs at which the metric criteria should be applied.
- Severity int
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- map[string]string
- A mapping of tags to assign to the resource.
- TargetResource stringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- TargetResource stringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- WindowSize string
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- actions
List<MetricAlert Action> 
- One or more actionblocks as defined below.
- 
MetricAlert Application Insights Web Test Location Availability Criteria 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- autoMitigate Boolean
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- criterias
List<MetricAlert Criteria> 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- description String
- The description of this Metric Alert.
- dynamicCriteria MetricAlert Dynamic Criteria 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- enabled Boolean
- Should this Metric Alert be enabled? Defaults to true.
- frequency String
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- name String
- The name of the Metric Alert. Changing this forces a new resource to be created.
- resourceGroup StringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes List<String>
- A set of strings of resource IDs at which the metric criteria should be applied.
- severity Integer
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- Map<String,String>
- A mapping of tags to assign to the resource.
- targetResource StringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- targetResource StringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- windowSize String
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- actions
MetricAlert Action[] 
- One or more actionblocks as defined below.
- 
MetricAlert Application Insights Web Test Location Availability Criteria 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- autoMitigate boolean
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- criterias
MetricAlert Criteria[] 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- description string
- The description of this Metric Alert.
- dynamicCriteria MetricAlert Dynamic Criteria 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- enabled boolean
- Should this Metric Alert be enabled? Defaults to true.
- frequency string
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- name string
- The name of the Metric Alert. Changing this forces a new resource to be created.
- resourceGroup stringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes string[]
- A set of strings of resource IDs at which the metric criteria should be applied.
- severity number
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- targetResource stringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- targetResource stringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- windowSize string
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- actions
Sequence[MetricAlert Action Args] 
- One or more actionblocks as defined below.
- application_insights_ Metricweb_ test_ location_ availability_ criteria Alert Application Insights Web Test Location Availability Criteria Args 
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- auto_mitigate bool
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- criterias
Sequence[MetricAlert Criteria Args] 
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- description str
- The description of this Metric Alert.
- dynamic_criteria MetricAlert Dynamic Criteria Args 
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- enabled bool
- Should this Metric Alert be enabled? Defaults to true.
- frequency str
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- name str
- The name of the Metric Alert. Changing this forces a new resource to be created.
- resource_group_ strname 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes Sequence[str]
- A set of strings of resource IDs at which the metric criteria should be applied.
- severity int
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- target_resource_ strlocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- target_resource_ strtype 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- window_size str
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
- actions List<Property Map>
- One or more actionblocks as defined below.
- Property Map
- A - application_insights_web_test_location_availability_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- autoMitigate Boolean
- Should the alerts in this Metric Alert be auto resolved? Defaults to true.
- criterias List<Property Map>
- One or more (static) - criteriablocks as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- description String
- The description of this Metric Alert.
- dynamicCriteria Property Map
- A - dynamic_criteriablock as defined below.- NOTE One of either - criteria,- dynamic_criteriaor- application_insights_web_test_location_availability_criteriamust be specified.
- enabled Boolean
- Should this Metric Alert be enabled? Defaults to true.
- frequency String
- The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M,PT5M,PT15M,PT30MandPT1H. Defaults toPT1M.
- name String
- The name of the Metric Alert. Changing this forces a new resource to be created.
- resourceGroup StringName 
- The name of the resource group in which to create the Metric Alert instance. Changing this forces a new resource to be created.
- scopes List<String>
- A set of strings of resource IDs at which the metric criteria should be applied.
- severity Number
- The severity of this Metric Alert. Possible values are 0,1,2,3and4. Defaults to3.
- Map<String>
- A mapping of tags to assign to the resource.
- targetResource StringLocation 
- The location of the target resource. - This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- targetResource StringType 
- The resource type (e.g. - Microsoft.Compute/virtualMachines) of the target resource.- This is Required when using a Subscription as scope, a Resource Group as scope or Multiple Scopes. 
- windowSize String
- The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values arePT1M,PT5M,PT15M,PT30M,PT1H,PT6H,PT12HandP1D. Defaults toPT5M.
Supporting Types
MetricAlertAction, MetricAlertActionArgs      
- ActionGroup stringId 
- The ID of the Action Group can be sourced from the azure.monitoring.ActionGroupresource
- WebhookProperties Dictionary<string, string>
- The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- ActionGroup stringId 
- The ID of the Action Group can be sourced from the azure.monitoring.ActionGroupresource
- WebhookProperties map[string]string
- The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- actionGroup StringId 
- The ID of the Action Group can be sourced from the azure.monitoring.ActionGroupresource
- webhookProperties Map<String,String>
- The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- actionGroup stringId 
- The ID of the Action Group can be sourced from the azure.monitoring.ActionGroupresource
- webhookProperties {[key: string]: string}
- The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- action_group_ strid 
- The ID of the Action Group can be sourced from the azure.monitoring.ActionGroupresource
- webhook_properties Mapping[str, str]
- The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
- actionGroup StringId 
- The ID of the Action Group can be sourced from the azure.monitoring.ActionGroupresource
- webhookProperties Map<String>
- The map of custom string properties to include with the post operation. These data are appended to the webhook payload.
MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteria, MetricAlertApplicationInsightsWebTestLocationAvailabilityCriteriaArgs                  
- ComponentId string
- The ID of the Application Insights Resource.
- FailedLocation intCount 
- The number of failed locations.
- WebTest stringId 
- The ID of the Application Insights Web Test.
- ComponentId string
- The ID of the Application Insights Resource.
- FailedLocation intCount 
- The number of failed locations.
- WebTest stringId 
- The ID of the Application Insights Web Test.
- componentId String
- The ID of the Application Insights Resource.
- failedLocation IntegerCount 
- The number of failed locations.
- webTest StringId 
- The ID of the Application Insights Web Test.
- componentId string
- The ID of the Application Insights Resource.
- failedLocation numberCount 
- The number of failed locations.
- webTest stringId 
- The ID of the Application Insights Web Test.
- component_id str
- The ID of the Application Insights Resource.
- failed_location_ intcount 
- The number of failed locations.
- web_test_ strid 
- The ID of the Application Insights Web Test.
- componentId String
- The ID of the Application Insights Resource.
- failedLocation NumberCount 
- The number of failed locations.
- webTest StringId 
- The ID of the Application Insights Web Test.
MetricAlertCriteria, MetricAlertCriteriaArgs      
- Aggregation string
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- MetricName string
- One of the metric names to be monitored.
- MetricNamespace string
- One of the metric namespaces to be monitored.
- Operator string
- The criteria operator. Possible values are Equals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.
- Threshold double
- The criteria threshold value that activates the alert.
- Dimensions
List<MetricAlert Criteria Dimension> 
- One or more dimensionblocks as defined below.
- SkipMetric boolValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to false.
- Aggregation string
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- MetricName string
- One of the metric names to be monitored.
- MetricNamespace string
- One of the metric namespaces to be monitored.
- Operator string
- The criteria operator. Possible values are Equals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.
- Threshold float64
- The criteria threshold value that activates the alert.
- Dimensions
[]MetricAlert Criteria Dimension 
- One or more dimensionblocks as defined below.
- SkipMetric boolValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to false.
- aggregation String
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- metricName String
- One of the metric names to be monitored.
- metricNamespace String
- One of the metric namespaces to be monitored.
- operator String
- The criteria operator. Possible values are Equals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.
- threshold Double
- The criteria threshold value that activates the alert.
- dimensions
List<MetricAlert Criteria Dimension> 
- One or more dimensionblocks as defined below.
- skipMetric BooleanValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to false.
- aggregation string
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- metricName string
- One of the metric names to be monitored.
- metricNamespace string
- One of the metric namespaces to be monitored.
- operator string
- The criteria operator. Possible values are Equals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.
- threshold number
- The criteria threshold value that activates the alert.
- dimensions
MetricAlert Criteria Dimension[] 
- One or more dimensionblocks as defined below.
- skipMetric booleanValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to false.
- aggregation str
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- metric_name str
- One of the metric names to be monitored.
- metric_namespace str
- One of the metric namespaces to be monitored.
- operator str
- The criteria operator. Possible values are Equals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.
- threshold float
- The criteria threshold value that activates the alert.
- dimensions
Sequence[MetricAlert Criteria Dimension] 
- One or more dimensionblocks as defined below.
- skip_metric_ boolvalidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to false.
- aggregation String
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- metricName String
- One of the metric names to be monitored.
- metricNamespace String
- One of the metric namespaces to be monitored.
- operator String
- The criteria operator. Possible values are Equals,GreaterThan,GreaterThanOrEqual,LessThanandLessThanOrEqual.
- threshold Number
- The criteria threshold value that activates the alert.
- dimensions List<Property Map>
- One or more dimensionblocks as defined below.
- skipMetric BooleanValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted? Defaults to false.
MetricAlertCriteriaDimension, MetricAlertCriteriaDimensionArgs        
MetricAlertDynamicCriteria, MetricAlertDynamicCriteriaArgs        
- Aggregation string
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- AlertSensitivity string
- The extent of deviation required to trigger an alert. Possible values are Low,MediumandHigh.
- MetricName string
- One of the metric names to be monitored.
- MetricNamespace string
- One of the metric namespaces to be monitored.
- Operator string
- The criteria operator. Possible values are LessThan,GreaterThanandGreaterOrLessThan.
- Dimensions
List<MetricAlert Dynamic Criteria Dimension> 
- One or more dimensionblocks as defined below.
- EvaluationFailure intCount 
- The number of violations to trigger an alert. Should be smaller or equal to evaluation_total_count. Defaults to4.
- EvaluationTotal intCount 
- The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (window_size) and the selected number of aggregated points. Defaults to4.
- IgnoreData stringBefore 
- The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- SkipMetric boolValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- Aggregation string
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- AlertSensitivity string
- The extent of deviation required to trigger an alert. Possible values are Low,MediumandHigh.
- MetricName string
- One of the metric names to be monitored.
- MetricNamespace string
- One of the metric namespaces to be monitored.
- Operator string
- The criteria operator. Possible values are LessThan,GreaterThanandGreaterOrLessThan.
- Dimensions
[]MetricAlert Dynamic Criteria Dimension 
- One or more dimensionblocks as defined below.
- EvaluationFailure intCount 
- The number of violations to trigger an alert. Should be smaller or equal to evaluation_total_count. Defaults to4.
- EvaluationTotal intCount 
- The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (window_size) and the selected number of aggregated points. Defaults to4.
- IgnoreData stringBefore 
- The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- SkipMetric boolValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- aggregation String
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- alertSensitivity String
- The extent of deviation required to trigger an alert. Possible values are Low,MediumandHigh.
- metricName String
- One of the metric names to be monitored.
- metricNamespace String
- One of the metric namespaces to be monitored.
- operator String
- The criteria operator. Possible values are LessThan,GreaterThanandGreaterOrLessThan.
- dimensions
List<MetricAlert Dynamic Criteria Dimension> 
- One or more dimensionblocks as defined below.
- evaluationFailure IntegerCount 
- The number of violations to trigger an alert. Should be smaller or equal to evaluation_total_count. Defaults to4.
- evaluationTotal IntegerCount 
- The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (window_size) and the selected number of aggregated points. Defaults to4.
- ignoreData StringBefore 
- The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- skipMetric BooleanValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- aggregation string
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- alertSensitivity string
- The extent of deviation required to trigger an alert. Possible values are Low,MediumandHigh.
- metricName string
- One of the metric names to be monitored.
- metricNamespace string
- One of the metric namespaces to be monitored.
- operator string
- The criteria operator. Possible values are LessThan,GreaterThanandGreaterOrLessThan.
- dimensions
MetricAlert Dynamic Criteria Dimension[] 
- One or more dimensionblocks as defined below.
- evaluationFailure numberCount 
- The number of violations to trigger an alert. Should be smaller or equal to evaluation_total_count. Defaults to4.
- evaluationTotal numberCount 
- The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (window_size) and the selected number of aggregated points. Defaults to4.
- ignoreData stringBefore 
- The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- skipMetric booleanValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- aggregation str
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- alert_sensitivity str
- The extent of deviation required to trigger an alert. Possible values are Low,MediumandHigh.
- metric_name str
- One of the metric names to be monitored.
- metric_namespace str
- One of the metric namespaces to be monitored.
- operator str
- The criteria operator. Possible values are LessThan,GreaterThanandGreaterOrLessThan.
- dimensions
Sequence[MetricAlert Dynamic Criteria Dimension] 
- One or more dimensionblocks as defined below.
- evaluation_failure_ intcount 
- The number of violations to trigger an alert. Should be smaller or equal to evaluation_total_count. Defaults to4.
- evaluation_total_ intcount 
- The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (window_size) and the selected number of aggregated points. Defaults to4.
- ignore_data_ strbefore 
- The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- skip_metric_ boolvalidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
- aggregation String
- The statistic that runs over the metric values. Possible values are Average,Count,Minimum,MaximumandTotal.
- alertSensitivity String
- The extent of deviation required to trigger an alert. Possible values are Low,MediumandHigh.
- metricName String
- One of the metric names to be monitored.
- metricNamespace String
- One of the metric namespaces to be monitored.
- operator String
- The criteria operator. Possible values are LessThan,GreaterThanandGreaterOrLessThan.
- dimensions List<Property Map>
- One or more dimensionblocks as defined below.
- evaluationFailure NumberCount 
- The number of violations to trigger an alert. Should be smaller or equal to evaluation_total_count. Defaults to4.
- evaluationTotal NumberCount 
- The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (window_size) and the selected number of aggregated points. Defaults to4.
- ignoreData StringBefore 
- The ISO8601 date from which to start learning the metric historical data and calculate the dynamic thresholds.
- skipMetric BooleanValidation 
- Skip the metric validation to allow creating an alert rule on a custom metric that isn't yet emitted?
MetricAlertDynamicCriteriaDimension, MetricAlertDynamicCriteriaDimensionArgs          
Import
Metric Alerts can be imported using the resource id, e.g.
$ pulumi import azure:monitoring/metricAlert:MetricAlert main /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.Insights/metricAlerts/example-metricalert
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.