Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Azure Native

v1.42.0 published on Monday, Oct 25, 2021 by Pulumi

MetricAlert

The metric alert resource. API Version: 2018-03-01.

Example Usage

Create or update a dynamic alert rule for Multiple Resources

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new AzureNative.Insights.MetricAlertArgs
        {
            Actions = 
            {
                new AzureNative.Insights.Inputs.MetricAlertActionArgs
                {
                    ActionGroupId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
                    WebHookProperties = 
                    {
                        { "key11", "value11" },
                        { "key12", "value12" },
                    },
                },
            },
            AutoMitigate = true,
            Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
            {
                AllOf = 
                {
                    new AzureNative.Insights.Inputs.DynamicMetricCriteriaArgs
                    {
                        AlertSensitivity = "Medium",
                        CriterionType = "DynamicThresholdCriterion",
                        Dimensions = {},
                        FailingPeriods = new AzureNative.Insights.Inputs.DynamicThresholdFailingPeriodsArgs
                        {
                            MinFailingPeriodsToAlert = 4,
                            NumberOfEvaluationPeriods = 4,
                        },
                        MetricName = "Percentage CPU",
                        MetricNamespace = "microsoft.compute/virtualmachines",
                        Name = "High_CPU_80",
                        Operator = "GreaterOrLessThan",
                        TimeAggregation = "Average",
                    },
                },
                OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
            },
            Description = "This is the description of the rule1",
            Enabled = true,
            EvaluationFrequency = "PT1M",
            Location = "global",
            ResourceGroupName = "gigtest",
            RuleName = "MetricAlertOnMultipleResources",
            Scopes = 
            {
                "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
                "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
            },
            Severity = 3,
            Tags = ,
            TargetResourceRegion = "southcentralus",
            TargetResourceType = "Microsoft.Compute/virtualMachines",
            WindowSize = "PT15M",
        });
    }

}

package main

import (
	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
			Actions: []insights.MetricAlertActionArgs{
				&insights.MetricAlertActionArgs{
					ActionGroupId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: pulumi.StringMap{
						"key11": pulumi.String("value11"),
						"key12": pulumi.String("value12"),
					},
				},
			},
			AutoMitigate: pulumi.Bool(true),
			Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
				AllOf: []interface{}{
					insights.DynamicMetricCriteria{
						AlertSensitivity: "Medium",
						CriterionType:    "DynamicThresholdCriterion",
						Dimensions:       []insights.MetricDimension{},
						FailingPeriods: insights.DynamicThresholdFailingPeriods{
							MinFailingPeriodsToAlert:  4,
							NumberOfEvaluationPeriods: 4,
						},
						MetricName:      "Percentage CPU",
						MetricNamespace: "microsoft.compute/virtualmachines",
						Name:            "High_CPU_80",
						Operator:        "GreaterOrLessThan",
						TimeAggregation: "Average",
					},
				},
				OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
			},
			Description:         pulumi.String("This is the description of the rule1"),
			Enabled:             pulumi.Bool(true),
			EvaluationFrequency: pulumi.String("PT1M"),
			Location:            pulumi.String("global"),
			ResourceGroupName:   pulumi.String("gigtest"),
			RuleName:            pulumi.String("MetricAlertOnMultipleResources"),
			Scopes: pulumi.StringArray{
				pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"),
				pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"),
			},
			Severity:             pulumi.Int(3),
			Tags:                 nil,
			TargetResourceRegion: pulumi.String("southcentralus"),
			TargetResourceType:   pulumi.String("Microsoft.Compute/virtualMachines"),
			WindowSize:           pulumi.String("PT15M"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_azure_native as azure_native

metric_alert = azure_native.insights.MetricAlert("metricAlert",
    actions=[azure_native.insights.MetricAlertActionArgs(
        action_group_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        web_hook_properties={
            "key11": "value11",
            "key12": "value12",
        },
    )],
    auto_mitigate=True,
    criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
        all_of=[azure_native.insights.DynamicMetricCriteriaArgs(
            alert_sensitivity="Medium",
            criterion_type="DynamicThresholdCriterion",
            dimensions=[],
            failing_periods=azure_native.insights.DynamicThresholdFailingPeriodsArgs(
                min_failing_periods_to_alert=4,
                number_of_evaluation_periods=4,
            ),
            metric_name="Percentage CPU",
            metric_namespace="microsoft.compute/virtualmachines",
            name="High_CPU_80",
            operator="GreaterOrLessThan",
            time_aggregation="Average",
        )],
        odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    ),
    description="This is the description of the rule1",
    enabled=True,
    evaluation_frequency="PT1M",
    location="global",
    resource_group_name="gigtest",
    rule_name="MetricAlertOnMultipleResources",
    scopes=[
        "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
        "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
    ],
    severity=3,
    tags={},
    target_resource_region="southcentralus",
    target_resource_type="Microsoft.Compute/virtualMachines",
    window_size="PT15M")

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
    actions: [{
        actionGroupId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        webHookProperties: {
            key11: "value11",
            key12: "value12",
        },
    }],
    autoMitigate: true,
    criteria: {
        allOf: [{
            alertSensitivity: "Medium",
            criterionType: "DynamicThresholdCriterion",
            dimensions: [],
            failingPeriods: {
                minFailingPeriodsToAlert: 4,
                numberOfEvaluationPeriods: 4,
            },
            metricName: "Percentage CPU",
            metricNamespace: "microsoft.compute/virtualmachines",
            name: "High_CPU_80",
            operator: "GreaterOrLessThan",
            timeAggregation: "Average",
        }],
        odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    },
    description: "This is the description of the rule1",
    enabled: true,
    evaluationFrequency: "PT1M",
    location: "global",
    resourceGroupName: "gigtest",
    ruleName: "MetricAlertOnMultipleResources",
    scopes: [
        "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
        "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
    ],
    severity: 3,
    tags: {},
    targetResourceRegion: "southcentralus",
    targetResourceType: "Microsoft.Compute/virtualMachines",
    windowSize: "PT15M",
});

Create or update a dynamic alert rule for Single Resource

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new AzureNative.Insights.MetricAlertArgs
        {
            Actions = 
            {
                new AzureNative.Insights.Inputs.MetricAlertActionArgs
                {
                    ActionGroupId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
                    WebHookProperties = 
                    {
                        { "key11", "value11" },
                        { "key12", "value12" },
                    },
                },
            },
            AutoMitigate = true,
            Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
            {
                AllOf = 
                {
                    new AzureNative.Insights.Inputs.DynamicMetricCriteriaArgs
                    {
                        AlertSensitivity = "Medium",
                        CriterionType = "DynamicThresholdCriterion",
                        Dimensions = {},
                        FailingPeriods = new AzureNative.Insights.Inputs.DynamicThresholdFailingPeriodsArgs
                        {
                            MinFailingPeriodsToAlert = 4,
                            NumberOfEvaluationPeriods = 4,
                        },
                        IgnoreDataBefore = "2019-04-04T21:00:00.000Z",
                        MetricName = "Percentage CPU",
                        MetricNamespace = "microsoft.compute/virtualmachines",
                        Name = "High_CPU_80",
                        Operator = "GreaterOrLessThan",
                        TimeAggregation = "Average",
                    },
                },
                OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
            },
            Description = "This is the description of the rule1",
            Enabled = true,
            EvaluationFrequency = "PT1M",
            Location = "global",
            ResourceGroupName = "gigtest",
            RuleName = "chiricutin",
            Scopes = 
            {
                "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme",
            },
            Severity = 3,
            Tags = ,
            WindowSize = "PT15M",
        });
    }

}

package main

import (
	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
			Actions: []insights.MetricAlertActionArgs{
				&insights.MetricAlertActionArgs{
					ActionGroupId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: pulumi.StringMap{
						"key11": pulumi.String("value11"),
						"key12": pulumi.String("value12"),
					},
				},
			},
			AutoMitigate: pulumi.Bool(true),
			Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
				AllOf: []interface{}{
					insights.DynamicMetricCriteria{
						AlertSensitivity: "Medium",
						CriterionType:    "DynamicThresholdCriterion",
						Dimensions:       []insights.MetricDimension{},
						FailingPeriods: insights.DynamicThresholdFailingPeriods{
							MinFailingPeriodsToAlert:  4,
							NumberOfEvaluationPeriods: 4,
						},
						IgnoreDataBefore: "2019-04-04T21:00:00.000Z",
						MetricName:       "Percentage CPU",
						MetricNamespace:  "microsoft.compute/virtualmachines",
						Name:             "High_CPU_80",
						Operator:         "GreaterOrLessThan",
						TimeAggregation:  "Average",
					},
				},
				OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
			},
			Description:         pulumi.String("This is the description of the rule1"),
			Enabled:             pulumi.Bool(true),
			EvaluationFrequency: pulumi.String("PT1M"),
			Location:            pulumi.String("global"),
			ResourceGroupName:   pulumi.String("gigtest"),
			RuleName:            pulumi.String("chiricutin"),
			Scopes: pulumi.StringArray{
				pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"),
			},
			Severity:   pulumi.Int(3),
			Tags:       nil,
			WindowSize: pulumi.String("PT15M"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_azure_native as azure_native

metric_alert = azure_native.insights.MetricAlert("metricAlert",
    actions=[azure_native.insights.MetricAlertActionArgs(
        action_group_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        web_hook_properties={
            "key11": "value11",
            "key12": "value12",
        },
    )],
    auto_mitigate=True,
    criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
        all_of=[azure_native.insights.DynamicMetricCriteriaArgs(
            alert_sensitivity="Medium",
            criterion_type="DynamicThresholdCriterion",
            dimensions=[],
            failing_periods=azure_native.insights.DynamicThresholdFailingPeriodsArgs(
                min_failing_periods_to_alert=4,
                number_of_evaluation_periods=4,
            ),
            ignore_data_before="2019-04-04T21:00:00.000Z",
            metric_name="Percentage CPU",
            metric_namespace="microsoft.compute/virtualmachines",
            name="High_CPU_80",
            operator="GreaterOrLessThan",
            time_aggregation="Average",
        )],
        odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    ),
    description="This is the description of the rule1",
    enabled=True,
    evaluation_frequency="PT1M",
    location="global",
    resource_group_name="gigtest",
    rule_name="chiricutin",
    scopes=["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"],
    severity=3,
    tags={},
    window_size="PT15M")

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
    actions: [{
        actionGroupId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        webHookProperties: {
            key11: "value11",
            key12: "value12",
        },
    }],
    autoMitigate: true,
    criteria: {
        allOf: [{
            alertSensitivity: "Medium",
            criterionType: "DynamicThresholdCriterion",
            dimensions: [],
            failingPeriods: {
                minFailingPeriodsToAlert: 4,
                numberOfEvaluationPeriods: 4,
            },
            ignoreDataBefore: "2019-04-04T21:00:00.000Z",
            metricName: "Percentage CPU",
            metricNamespace: "microsoft.compute/virtualmachines",
            name: "High_CPU_80",
            operator: "GreaterOrLessThan",
            timeAggregation: "Average",
        }],
        odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    },
    description: "This is the description of the rule1",
    enabled: true,
    evaluationFrequency: "PT1M",
    location: "global",
    resourceGroupName: "gigtest",
    ruleName: "chiricutin",
    scopes: ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"],
    severity: 3,
    tags: {},
    windowSize: "PT15M",
});

Create or update a web test alert rule

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new AzureNative.Insights.MetricAlertArgs
        {
            Actions = {},
            Criteria = new AzureNative.Insights.Inputs.WebtestLocationAvailabilityCriteriaArgs
            {
                ComponentId = "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
                FailedLocationCount = 2,
                OdataType = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
                WebTestId = "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
            },
            Description = "Automatically created alert rule for availability test \"component-example\" a",
            Enabled = true,
            EvaluationFrequency = "PT1M",
            Location = "global",
            ResourceGroupName = "rg-example",
            RuleName = "webtest-name-example",
            Scopes = 
            {
                "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
                "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
            },
            Severity = 4,
            Tags = 
            {
                { "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", "Resource" },
                { "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", "Resource" },
            },
            WindowSize = "PT15M",
        });
    }

}

package main

import (
	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
			Actions: insights.MetricAlertActionArray{},
			Criteria: insights.WebtestLocationAvailabilityCriteria{
				ComponentId:         "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
				FailedLocationCount: 2,
				OdataType:           "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
				WebTestId:           "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
			},
			Description:         pulumi.String("Automatically created alert rule for availability test \"component-example\" a"),
			Enabled:             pulumi.Bool(true),
			EvaluationFrequency: pulumi.String("PT1M"),
			Location:            pulumi.String("global"),
			ResourceGroupName:   pulumi.String("rg-example"),
			RuleName:            pulumi.String("webtest-name-example"),
			Scopes: pulumi.StringArray{
				pulumi.String("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example"),
				pulumi.String("/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example"),
			},
			Severity: pulumi.Int(4),
			Tags: pulumi.StringMap{
				"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example": pulumi.String("Resource"),
				"hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example":      pulumi.String("Resource"),
			},
			WindowSize: pulumi.String("PT15M"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_azure_native as azure_native

metric_alert = azure_native.insights.MetricAlert("metricAlert",
    actions=[],
    criteria=azure_native.insights.WebtestLocationAvailabilityCriteriaArgs(
        component_id="/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
        failed_location_count=2,
        odata_type="Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
        web_test_id="/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
    ),
    description="Automatically created alert rule for availability test \"component-example\" a",
    enabled=True,
    evaluation_frequency="PT1M",
    location="global",
    resource_group_name="rg-example",
    rule_name="webtest-name-example",
    scopes=[
        "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
        "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
    ],
    severity=4,
    tags={
        "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example": "Resource",
        "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example": "Resource",
    },
    window_size="PT15M")

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
    actions: [],
    criteria: {
        componentId: "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
        failedLocationCount: 2,
        odataType: "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
        webTestId: "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
    },
    description: "Automatically created alert rule for availability test \"component-example\" a",
    enabled: true,
    evaluationFrequency: "PT1M",
    location: "global",
    resourceGroupName: "rg-example",
    ruleName: "webtest-name-example",
    scopes: [
        "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example",
        "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example",
    ],
    severity: 4,
    tags: {
        "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example": "Resource",
        "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example": "Resource",
    },
    windowSize: "PT15M",
});

Create or update an alert rule for Multiple Resource

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new AzureNative.Insights.MetricAlertArgs
        {
            Actions = 
            {
                new AzureNative.Insights.Inputs.MetricAlertActionArgs
                {
                    ActionGroupId = "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
                    WebHookProperties = 
                    {
                        { "key11", "value11" },
                        { "key12", "value12" },
                    },
                },
            },
            AutoMitigate = true,
            Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
            {
                AllOf = 
                {
                    new AzureNative.Insights.Inputs.MetricCriteriaArgs
                    {
                        CriterionType = "StaticThresholdCriterion",
                        Dimensions = {},
                        MetricName = "Percentage CPU",
                        MetricNamespace = "microsoft.compute/virtualmachines",
                        Name = "High_CPU_80",
                        Operator = "GreaterThan",
                        Threshold = 80.5,
                        TimeAggregation = "Average",
                    },
                },
                OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
            },
            Description = "This is the description of the rule1",
            Enabled = true,
            EvaluationFrequency = "PT1M",
            Location = "global",
            ResourceGroupName = "gigtest",
            RuleName = "MetricAlertOnMultipleResources",
            Scopes = 
            {
                "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
                "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
            },
            Severity = 3,
            Tags = ,
            TargetResourceRegion = "southcentralus",
            TargetResourceType = "Microsoft.Compute/virtualMachines",
            WindowSize = "PT15M",
        });
    }

}

package main

import (
	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
			Actions: []insights.MetricAlertActionArgs{
				&insights.MetricAlertActionArgs{
					ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: pulumi.StringMap{
						"key11": pulumi.String("value11"),
						"key12": pulumi.String("value12"),
					},
				},
			},
			AutoMitigate: pulumi.Bool(true),
			Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
				AllOf: []interface{}{
					insights.MetricCriteria{
						CriterionType:   "StaticThresholdCriterion",
						Dimensions:      []insights.MetricDimension{},
						MetricName:      "Percentage CPU",
						MetricNamespace: "microsoft.compute/virtualmachines",
						Name:            "High_CPU_80",
						Operator:        "GreaterThan",
						Threshold:       80.5,
						TimeAggregation: "Average",
					},
				},
				OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
			},
			Description:         pulumi.String("This is the description of the rule1"),
			Enabled:             pulumi.Bool(true),
			EvaluationFrequency: pulumi.String("PT1M"),
			Location:            pulumi.String("global"),
			ResourceGroupName:   pulumi.String("gigtest"),
			RuleName:            pulumi.String("MetricAlertOnMultipleResources"),
			Scopes: pulumi.StringArray{
				pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1"),
				pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2"),
			},
			Severity:             pulumi.Int(3),
			Tags:                 nil,
			TargetResourceRegion: pulumi.String("southcentralus"),
			TargetResourceType:   pulumi.String("Microsoft.Compute/virtualMachines"),
			WindowSize:           pulumi.String("PT15M"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_azure_native as azure_native

metric_alert = azure_native.insights.MetricAlert("metricAlert",
    actions=[azure_native.insights.MetricAlertActionArgs(
        action_group_id="/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        web_hook_properties={
            "key11": "value11",
            "key12": "value12",
        },
    )],
    auto_mitigate=True,
    criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
        all_of=[azure_native.insights.MetricCriteriaArgs(
            criterion_type="StaticThresholdCriterion",
            dimensions=[],
            metric_name="Percentage CPU",
            metric_namespace="microsoft.compute/virtualmachines",
            name="High_CPU_80",
            operator="GreaterThan",
            threshold=80.5,
            time_aggregation="Average",
        )],
        odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    ),
    description="This is the description of the rule1",
    enabled=True,
    evaluation_frequency="PT1M",
    location="global",
    resource_group_name="gigtest",
    rule_name="MetricAlertOnMultipleResources",
    scopes=[
        "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
        "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
    ],
    severity=3,
    tags={},
    target_resource_region="southcentralus",
    target_resource_type="Microsoft.Compute/virtualMachines",
    window_size="PT15M")

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
    actions: [{
        actionGroupId: "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        webHookProperties: {
            key11: "value11",
            key12: "value12",
        },
    }],
    autoMitigate: true,
    criteria: {
        allOf: [{
            criterionType: "StaticThresholdCriterion",
            dimensions: [],
            metricName: "Percentage CPU",
            metricNamespace: "microsoft.compute/virtualmachines",
            name: "High_CPU_80",
            operator: "GreaterThan",
            threshold: 80.5,
            timeAggregation: "Average",
        }],
        odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    },
    description: "This is the description of the rule1",
    enabled: true,
    evaluationFrequency: "PT1M",
    location: "global",
    resourceGroupName: "gigtest",
    ruleName: "MetricAlertOnMultipleResources",
    scopes: [
        "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme1",
        "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme2",
    ],
    severity: 3,
    tags: {},
    targetResourceRegion: "southcentralus",
    targetResourceType: "Microsoft.Compute/virtualMachines",
    windowSize: "PT15M",
});

Create or update an alert rule for Single Resource

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new AzureNative.Insights.MetricAlertArgs
        {
            Actions = 
            {
                new AzureNative.Insights.Inputs.MetricAlertActionArgs
                {
                    ActionGroupId = "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
                    WebHookProperties = 
                    {
                        { "key11", "value11" },
                        { "key12", "value12" },
                    },
                },
            },
            AutoMitigate = true,
            Criteria = new AzureNative.Insights.Inputs.MetricAlertSingleResourceMultipleMetricCriteriaArgs
            {
                AllOf = 
                {
                    new AzureNative.Insights.Inputs.MetricCriteriaArgs
                    {
                        CriterionType = "StaticThresholdCriterion",
                        Dimensions = {},
                        MetricName = "\\Processor(_Total)\\% Processor Time",
                        Name = "High_CPU_80",
                        Operator = "GreaterThan",
                        Threshold = 80.5,
                        TimeAggregation = "Average",
                    },
                },
                OdataType = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
            },
            Description = "This is the description of the rule1",
            Enabled = true,
            EvaluationFrequency = "Pt1m",
            Location = "global",
            ResourceGroupName = "gigtest",
            RuleName = "chiricutin",
            Scopes = 
            {
                "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme",
            },
            Severity = 3,
            Tags = ,
            WindowSize = "Pt15m",
        });
    }

}

package main

import (
	"fmt"

	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
			Actions: []insights.MetricAlertActionArgs{
				&insights.MetricAlertActionArgs{
					ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: pulumi.StringMap{
						"key11": pulumi.String("value11"),
						"key12": pulumi.String("value12"),
					},
				},
			},
			AutoMitigate: pulumi.Bool(true),
			Criteria: insights.MetricAlertSingleResourceMultipleMetricCriteria{
				AllOf: []insights.MetricCriteria{
					insights.MetricCriteria{
						CriterionType:   "StaticThresholdCriterion",
						Dimensions:      []insights.MetricDimension{},
						MetricName:      fmt.Sprintf("%v%v%v", "\\Processor(_Total)\\", "%", " Processor Time"),
						Name:            "High_CPU_80",
						Operator:        "GreaterThan",
						Threshold:       80.5,
						TimeAggregation: "Average",
					},
				},
				OdataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
			},
			Description:         pulumi.String("This is the description of the rule1"),
			Enabled:             pulumi.Bool(true),
			EvaluationFrequency: pulumi.String("Pt1m"),
			Location:            pulumi.String("global"),
			ResourceGroupName:   pulumi.String("gigtest"),
			RuleName:            pulumi.String("chiricutin"),
			Scopes: pulumi.StringArray{
				pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"),
			},
			Severity:   pulumi.Int(3),
			Tags:       nil,
			WindowSize: pulumi.String("Pt15m"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_azure_native as azure_native

metric_alert = azure_native.insights.MetricAlert("metricAlert",
    actions=[azure_native.insights.MetricAlertActionArgs(
        action_group_id="/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        web_hook_properties={
            "key11": "value11",
            "key12": "value12",
        },
    )],
    auto_mitigate=True,
    criteria=azure_native.insights.MetricAlertSingleResourceMultipleMetricCriteriaArgs(
        all_of=[azure_native.insights.MetricCriteriaArgs(
            criterion_type="StaticThresholdCriterion",
            dimensions=[],
            metric_name="\\Processor(_Total)\\% Processor Time",
            name="High_CPU_80",
            operator="GreaterThan",
            threshold=80.5,
            time_aggregation="Average",
        )],
        odata_type="Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
    ),
    description="This is the description of the rule1",
    enabled=True,
    evaluation_frequency="Pt1m",
    location="global",
    resource_group_name="gigtest",
    rule_name="chiricutin",
    scopes=["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"],
    severity=3,
    tags={},
    window_size="Pt15m")

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
    actions: [{
        actionGroupId: "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        webHookProperties: {
            key11: "value11",
            key12: "value12",
        },
    }],
    autoMitigate: true,
    criteria: {
        allOf: [{
            criterionType: "StaticThresholdCriterion",
            dimensions: [],
            metricName: `\Processor(_Total)\% Processor Time`,
            name: "High_CPU_80",
            operator: "GreaterThan",
            threshold: 80.5,
            timeAggregation: "Average",
        }],
        odataType: "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
    },
    description: "This is the description of the rule1",
    enabled: true,
    evaluationFrequency: "Pt1m",
    location: "global",
    resourceGroupName: "gigtest",
    ruleName: "chiricutin",
    scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme"],
    severity: 3,
    tags: {},
    windowSize: "Pt15m",
});

Create or update an alert rule on Resource group(s)

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new AzureNative.Insights.MetricAlertArgs
        {
            Actions = 
            {
                new AzureNative.Insights.Inputs.MetricAlertActionArgs
                {
                    ActionGroupId = "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
                    WebHookProperties = 
                    {
                        { "key11", "value11" },
                        { "key12", "value12" },
                    },
                },
            },
            AutoMitigate = true,
            Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
            {
                AllOf = 
                {
                    new AzureNative.Insights.Inputs.MetricCriteriaArgs
                    {
                        CriterionType = "StaticThresholdCriterion",
                        Dimensions = {},
                        MetricName = "Percentage CPU",
                        MetricNamespace = "microsoft.compute/virtualmachines",
                        Name = "High_CPU_80",
                        Operator = "GreaterThan",
                        Threshold = 80.5,
                        TimeAggregation = "Average",
                    },
                },
                OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
            },
            Description = "This is the description of the rule1",
            Enabled = true,
            EvaluationFrequency = "PT1M",
            Location = "global",
            ResourceGroupName = "gigtest1",
            RuleName = "MetricAlertAtResourceGroupLevel",
            Scopes = 
            {
                "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
                "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2",
            },
            Severity = 3,
            Tags = ,
            TargetResourceRegion = "southcentralus",
            TargetResourceType = "Microsoft.Compute/virtualMachines",
            WindowSize = "PT15M",
        });
    }

}

package main

import (
	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
			Actions: []insights.MetricAlertActionArgs{
				&insights.MetricAlertActionArgs{
					ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: pulumi.StringMap{
						"key11": pulumi.String("value11"),
						"key12": pulumi.String("value12"),
					},
				},
			},
			AutoMitigate: pulumi.Bool(true),
			Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
				AllOf: []interface{}{
					insights.MetricCriteria{
						CriterionType:   "StaticThresholdCriterion",
						Dimensions:      []insights.MetricDimension{},
						MetricName:      "Percentage CPU",
						MetricNamespace: "microsoft.compute/virtualmachines",
						Name:            "High_CPU_80",
						Operator:        "GreaterThan",
						Threshold:       80.5,
						TimeAggregation: "Average",
					},
				},
				OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
			},
			Description:         pulumi.String("This is the description of the rule1"),
			Enabled:             pulumi.Bool(true),
			EvaluationFrequency: pulumi.String("PT1M"),
			Location:            pulumi.String("global"),
			ResourceGroupName:   pulumi.String("gigtest1"),
			RuleName:            pulumi.String("MetricAlertAtResourceGroupLevel"),
			Scopes: pulumi.StringArray{
				pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1"),
				pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2"),
			},
			Severity:             pulumi.Int(3),
			Tags:                 nil,
			TargetResourceRegion: pulumi.String("southcentralus"),
			TargetResourceType:   pulumi.String("Microsoft.Compute/virtualMachines"),
			WindowSize:           pulumi.String("PT15M"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_azure_native as azure_native

metric_alert = azure_native.insights.MetricAlert("metricAlert",
    actions=[azure_native.insights.MetricAlertActionArgs(
        action_group_id="/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        web_hook_properties={
            "key11": "value11",
            "key12": "value12",
        },
    )],
    auto_mitigate=True,
    criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
        all_of=[azure_native.insights.MetricCriteriaArgs(
            criterion_type="StaticThresholdCriterion",
            dimensions=[],
            metric_name="Percentage CPU",
            metric_namespace="microsoft.compute/virtualmachines",
            name="High_CPU_80",
            operator="GreaterThan",
            threshold=80.5,
            time_aggregation="Average",
        )],
        odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    ),
    description="This is the description of the rule1",
    enabled=True,
    evaluation_frequency="PT1M",
    location="global",
    resource_group_name="gigtest1",
    rule_name="MetricAlertAtResourceGroupLevel",
    scopes=[
        "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
        "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2",
    ],
    severity=3,
    tags={},
    target_resource_region="southcentralus",
    target_resource_type="Microsoft.Compute/virtualMachines",
    window_size="PT15M")

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
    actions: [{
        actionGroupId: "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        webHookProperties: {
            key11: "value11",
            key12: "value12",
        },
    }],
    autoMitigate: true,
    criteria: {
        allOf: [{
            criterionType: "StaticThresholdCriterion",
            dimensions: [],
            metricName: "Percentage CPU",
            metricNamespace: "microsoft.compute/virtualmachines",
            name: "High_CPU_80",
            operator: "GreaterThan",
            threshold: 80.5,
            timeAggregation: "Average",
        }],
        odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    },
    description: "This is the description of the rule1",
    enabled: true,
    evaluationFrequency: "PT1M",
    location: "global",
    resourceGroupName: "gigtest1",
    ruleName: "MetricAlertAtResourceGroupLevel",
    scopes: [
        "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
        "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2",
    ],
    severity: 3,
    tags: {},
    targetResourceRegion: "southcentralus",
    targetResourceType: "Microsoft.Compute/virtualMachines",
    windowSize: "PT15M",
});

Create or update an alert rule on Subscription

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new AzureNative.Insights.MetricAlertArgs
        {
            Actions = 
            {
                new AzureNative.Insights.Inputs.MetricAlertActionArgs
                {
                    ActionGroupId = "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
                    WebHookProperties = 
                    {
                        { "key11", "value11" },
                        { "key12", "value12" },
                    },
                },
            },
            AutoMitigate = true,
            Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
            {
                AllOf = 
                {
                    new AzureNative.Insights.Inputs.MetricCriteriaArgs
                    {
                        CriterionType = "StaticThresholdCriterion",
                        Dimensions = {},
                        MetricName = "Percentage CPU",
                        MetricNamespace = "microsoft.compute/virtualmachines",
                        Name = "High_CPU_80",
                        Operator = "GreaterThan",
                        Threshold = 80.5,
                        TimeAggregation = "Average",
                    },
                },
                OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
            },
            Description = "This is the description of the rule1",
            Enabled = true,
            EvaluationFrequency = "PT1M",
            Location = "global",
            ResourceGroupName = "gigtest",
            RuleName = "MetricAlertAtSubscriptionLevel",
            Scopes = 
            {
                "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7",
            },
            Severity = 3,
            Tags = ,
            TargetResourceRegion = "southcentralus",
            TargetResourceType = "Microsoft.Compute/virtualMachines",
            WindowSize = "PT15M",
        });
    }

}

package main

import (
	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
			Actions: []insights.MetricAlertActionArgs{
				&insights.MetricAlertActionArgs{
					ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: pulumi.StringMap{
						"key11": pulumi.String("value11"),
						"key12": pulumi.String("value12"),
					},
				},
			},
			AutoMitigate: pulumi.Bool(true),
			Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
				AllOf: []interface{}{
					insights.MetricCriteria{
						CriterionType:   "StaticThresholdCriterion",
						Dimensions:      []insights.MetricDimension{},
						MetricName:      "Percentage CPU",
						MetricNamespace: "microsoft.compute/virtualmachines",
						Name:            "High_CPU_80",
						Operator:        "GreaterThan",
						Threshold:       80.5,
						TimeAggregation: "Average",
					},
				},
				OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
			},
			Description:         pulumi.String("This is the description of the rule1"),
			Enabled:             pulumi.Bool(true),
			EvaluationFrequency: pulumi.String("PT1M"),
			Location:            pulumi.String("global"),
			ResourceGroupName:   pulumi.String("gigtest"),
			RuleName:            pulumi.String("MetricAlertAtSubscriptionLevel"),
			Scopes: pulumi.StringArray{
				pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"),
			},
			Severity:             pulumi.Int(3),
			Tags:                 nil,
			TargetResourceRegion: pulumi.String("southcentralus"),
			TargetResourceType:   pulumi.String("Microsoft.Compute/virtualMachines"),
			WindowSize:           pulumi.String("PT15M"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_azure_native as azure_native

metric_alert = azure_native.insights.MetricAlert("metricAlert",
    actions=[azure_native.insights.MetricAlertActionArgs(
        action_group_id="/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        web_hook_properties={
            "key11": "value11",
            "key12": "value12",
        },
    )],
    auto_mitigate=True,
    criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
        all_of=[azure_native.insights.MetricCriteriaArgs(
            criterion_type="StaticThresholdCriterion",
            dimensions=[],
            metric_name="Percentage CPU",
            metric_namespace="microsoft.compute/virtualmachines",
            name="High_CPU_80",
            operator="GreaterThan",
            threshold=80.5,
            time_aggregation="Average",
        )],
        odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    ),
    description="This is the description of the rule1",
    enabled=True,
    evaluation_frequency="PT1M",
    location="global",
    resource_group_name="gigtest",
    rule_name="MetricAlertAtSubscriptionLevel",
    scopes=["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"],
    severity=3,
    tags={},
    target_resource_region="southcentralus",
    target_resource_type="Microsoft.Compute/virtualMachines",
    window_size="PT15M")

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
    actions: [{
        actionGroupId: "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        webHookProperties: {
            key11: "value11",
            key12: "value12",
        },
    }],
    autoMitigate: true,
    criteria: {
        allOf: [{
            criterionType: "StaticThresholdCriterion",
            dimensions: [],
            metricName: "Percentage CPU",
            metricNamespace: "microsoft.compute/virtualmachines",
            name: "High_CPU_80",
            operator: "GreaterThan",
            threshold: 80.5,
            timeAggregation: "Average",
        }],
        odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    },
    description: "This is the description of the rule1",
    enabled: true,
    evaluationFrequency: "PT1M",
    location: "global",
    resourceGroupName: "gigtest",
    ruleName: "MetricAlertAtSubscriptionLevel",
    scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7"],
    severity: 3,
    tags: {},
    targetResourceRegion: "southcentralus",
    targetResourceType: "Microsoft.Compute/virtualMachines",
    windowSize: "PT15M",
});

Create or update an alert rules with dimensions

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new AzureNative.Insights.MetricAlertArgs
        {
            Actions = 
            {
                new AzureNative.Insights.Inputs.MetricAlertActionArgs
                {
                    ActionGroupId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
                    WebHookProperties = 
                    {
                        { "key11", "value11" },
                        { "key12", "value12" },
                    },
                },
            },
            AutoMitigate = true,
            Criteria = new AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs
            {
                AllOf = 
                {
                    new AzureNative.Insights.Inputs.MetricCriteriaArgs
                    {
                        CriterionType = "StaticThresholdCriterion",
                        Dimensions = 
                        {
                            new AzureNative.Insights.Inputs.MetricDimensionArgs
                            {
                                Name = "ActivityName",
                                Operator = "Include",
                                Values = 
                                {
                                    "*",
                                },
                            },
                            new AzureNative.Insights.Inputs.MetricDimensionArgs
                            {
                                Name = "StatusCode",
                                Operator = "Include",
                                Values = 
                                {
                                    "200",
                                },
                            },
                        },
                        MetricName = "Availability",
                        MetricNamespace = "Microsoft.KeyVault/vaults",
                        Name = "Metric1",
                        Operator = "GreaterThan",
                        Threshold = 55,
                        TimeAggregation = "Average",
                    },
                },
                OdataType = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
            },
            Description = "This is the description of the rule1",
            Enabled = true,
            EvaluationFrequency = "PT1H",
            Location = "global",
            ResourceGroupName = "gigtest",
            RuleName = "MetricAlertOnMultipleDimensions",
            Scopes = 
            {
                "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource",
            },
            Severity = 3,
            Tags = ,
            WindowSize = "P1D",
        });
    }

}

package main

import (
	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewMetricAlert(ctx, "metricAlert", &insights.MetricAlertArgs{
			Actions: []insights.MetricAlertActionArgs{
				&insights.MetricAlertActionArgs{
					ActionGroupId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: pulumi.StringMap{
						"key11": pulumi.String("value11"),
						"key12": pulumi.String("value12"),
					},
				},
			},
			AutoMitigate: pulumi.Bool(true),
			Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
				AllOf: []interface{}{
					insights.MetricCriteria{
						CriterionType: "StaticThresholdCriterion",
						Dimensions: []insights.MetricDimension{
							insights.MetricDimension{
								Name:     "ActivityName",
								Operator: "Include",
								Values: []string{
									"*",
								},
							},
							insights.MetricDimension{
								Name:     "StatusCode",
								Operator: "Include",
								Values: []string{
									"200",
								},
							},
						},
						MetricName:      "Availability",
						MetricNamespace: "Microsoft.KeyVault/vaults",
						Name:            "Metric1",
						Operator:        "GreaterThan",
						Threshold:       55,
						TimeAggregation: "Average",
					},
				},
				OdataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
			},
			Description:         pulumi.String("This is the description of the rule1"),
			Enabled:             pulumi.Bool(true),
			EvaluationFrequency: pulumi.String("PT1H"),
			Location:            pulumi.String("global"),
			ResourceGroupName:   pulumi.String("gigtest"),
			RuleName:            pulumi.String("MetricAlertOnMultipleDimensions"),
			Scopes: pulumi.StringArray{
				pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource"),
			},
			Severity:   pulumi.Int(3),
			Tags:       nil,
			WindowSize: pulumi.String("P1D"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_azure_native as azure_native

metric_alert = azure_native.insights.MetricAlert("metricAlert",
    actions=[azure_native.insights.MetricAlertActionArgs(
        action_group_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        web_hook_properties={
            "key11": "value11",
            "key12": "value12",
        },
    )],
    auto_mitigate=True,
    criteria=azure_native.insights.MetricAlertMultipleResourceMultipleMetricCriteriaArgs(
        all_of=[azure_native.insights.MetricCriteriaArgs(
            criterion_type="StaticThresholdCriterion",
            dimensions=[
                azure_native.insights.MetricDimensionArgs(
                    name="ActivityName",
                    operator="Include",
                    values=["*"],
                ),
                azure_native.insights.MetricDimensionArgs(
                    name="StatusCode",
                    operator="Include",
                    values=["200"],
                ),
            ],
            metric_name="Availability",
            metric_namespace="Microsoft.KeyVault/vaults",
            name="Metric1",
            operator="GreaterThan",
            threshold=55,
            time_aggregation="Average",
        )],
        odata_type="Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    ),
    description="This is the description of the rule1",
    enabled=True,
    evaluation_frequency="PT1H",
    location="global",
    resource_group_name="gigtest",
    rule_name="MetricAlertOnMultipleDimensions",
    scopes=["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource"],
    severity=3,
    tags={},
    window_size="P1D")

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const metricAlert = new azure_native.insights.MetricAlert("metricAlert", {
    actions: [{
        actionGroupId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2",
        webHookProperties: {
            key11: "value11",
            key12: "value12",
        },
    }],
    autoMitigate: true,
    criteria: {
        allOf: [{
            criterionType: "StaticThresholdCriterion",
            dimensions: [
                {
                    name: "ActivityName",
                    operator: "Include",
                    values: ["*"],
                },
                {
                    name: "StatusCode",
                    operator: "Include",
                    values: ["200"],
                },
            ],
            metricName: "Availability",
            metricNamespace: "Microsoft.KeyVault/vaults",
            name: "Metric1",
            operator: "GreaterThan",
            threshold: 55,
            timeAggregation: "Average",
        }],
        odataType: "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
    },
    description: "This is the description of the rule1",
    enabled: true,
    evaluationFrequency: "PT1H",
    location: "global",
    resourceGroupName: "gigtest",
    ruleName: "MetricAlertOnMultipleDimensions",
    scopes: ["/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource"],
    severity: 3,
    tags: {},
    windowSize: "P1D",
});

Create a MetricAlert Resource

new MetricAlert(name: string, args: MetricAlertArgs, opts?: CustomResourceOptions);
@overload
def MetricAlert(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                actions: Optional[Sequence[MetricAlertActionArgs]] = None,
                auto_mitigate: Optional[bool] = None,
                criteria: Optional[Union[MetricAlertMultipleResourceMultipleMetricCriteriaArgs, MetricAlertSingleResourceMultipleMetricCriteriaArgs, WebtestLocationAvailabilityCriteriaArgs]] = None,
                description: Optional[str] = None,
                enabled: Optional[bool] = None,
                evaluation_frequency: Optional[str] = None,
                location: Optional[str] = None,
                resource_group_name: Optional[str] = None,
                rule_name: Optional[str] = None,
                scopes: Optional[Sequence[str]] = None,
                severity: Optional[int] = None,
                tags: Optional[Mapping[str, str]] = None,
                target_resource_region: Optional[str] = None,
                target_resource_type: Optional[str] = None,
                window_size: Optional[str] = None)
@overload
def MetricAlert(resource_name: str,
                args: MetricAlertArgs,
                opts: Optional[ResourceOptions] = None)
func NewMetricAlert(ctx *Context, name string, args MetricAlertArgs, opts ...ResourceOption) (*MetricAlert, error)
public MetricAlert(string name, MetricAlertArgs args, CustomResourceOptions? opts = null)
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.

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

The MetricAlert resource accepts the following input properties:

Criteria Pulumi.AzureNative.Insights.Inputs.MetricAlertMultipleResourceMultipleMetricCriteriaArgs | Pulumi.AzureNative.Insights.Inputs.MetricAlertSingleResourceMultipleMetricCriteriaArgs | Pulumi.AzureNative.Insights.Inputs.WebtestLocationAvailabilityCriteriaArgs
defines the specific alert criteria information.
Enabled bool
the flag that indicates whether the metric alert is enabled.
EvaluationFrequency string
how often the metric alert is evaluated represented in ISO 8601 duration format.
ResourceGroupName string
The name of the resource group.
Scopes List<string>
the list of resource id’s that this metric alert is scoped to.
Severity int
Alert severity {0, 1, 2, 3, 4}
WindowSize string
the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
Actions List<Pulumi.AzureNative.Insights.Inputs.MetricAlertActionArgs>
the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
AutoMitigate bool
the flag that indicates whether the alert should be auto resolved or not. The default is true.
Description string
the description of the metric alert that will be included in the alert email.
Location string
Resource location
RuleName string
The name of the rule.
Tags Dictionary<string, string>
Resource tags
TargetResourceRegion string
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.
TargetResourceType string
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.
Criteria MetricAlertMultipleResourceMultipleMetricCriteriaArgs | MetricAlertSingleResourceMultipleMetricCriteriaArgs | WebtestLocationAvailabilityCriteriaArgs
defines the specific alert criteria information.
Enabled bool
the flag that indicates whether the metric alert is enabled.
EvaluationFrequency string
how often the metric alert is evaluated represented in ISO 8601 duration format.
ResourceGroupName string
The name of the resource group.
Scopes []string
the list of resource id’s that this metric alert is scoped to.
Severity int
Alert severity {0, 1, 2, 3, 4}
WindowSize string
the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
Actions []MetricAlertActionArgs
the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
AutoMitigate bool
the flag that indicates whether the alert should be auto resolved or not. The default is true.
Description string
the description of the metric alert that will be included in the alert email.
Location string
Resource location
RuleName string
The name of the rule.
Tags map[string]string
Resource tags
TargetResourceRegion string
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.
TargetResourceType string
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.
criteria MetricAlertMultipleResourceMultipleMetricCriteriaArgs | MetricAlertSingleResourceMultipleMetricCriteriaArgs | WebtestLocationAvailabilityCriteriaArgs
defines the specific alert criteria information.
enabled boolean
the flag that indicates whether the metric alert is enabled.
evaluationFrequency string
how often the metric alert is evaluated represented in ISO 8601 duration format.
resourceGroupName string
The name of the resource group.
scopes string[]
the list of resource id’s that this metric alert is scoped to.
severity number
Alert severity {0, 1, 2, 3, 4}
windowSize string
the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
actions MetricAlertActionArgs[]
the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
autoMitigate boolean
the flag that indicates whether the alert should be auto resolved or not. The default is true.
description string
the description of the metric alert that will be included in the alert email.
location string
Resource location
ruleName string
The name of the rule.
tags {[key: string]: string}
Resource tags
targetResourceRegion string
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.
targetResourceType string
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.
criteria MetricAlertMultipleResourceMultipleMetricCriteriaArgs | MetricAlertSingleResourceMultipleMetricCriteriaArgs | WebtestLocationAvailabilityCriteriaArgs
defines the specific alert criteria information.
enabled bool
the flag that indicates whether the metric alert is enabled.
evaluation_frequency str
how often the metric alert is evaluated represented in ISO 8601 duration format.
resource_group_name str
The name of the resource group.
scopes Sequence[str]
the list of resource id’s that this metric alert is scoped to.
severity int
Alert severity {0, 1, 2, 3, 4}
window_size str
the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold.
actions Sequence[MetricAlertActionArgs]
the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
auto_mitigate bool
the flag that indicates whether the alert should be auto resolved or not. The default is true.
description str
the description of the metric alert that will be included in the alert email.
location str
Resource location
rule_name str
The name of the rule.
tags Mapping[str, str]
Resource tags
target_resource_region str
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.
target_resource_type str
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.

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.
IsMigrated bool
the value indicating whether this alert rule is migrated.
LastUpdatedTime string
Last time the rule was updated in ISO8601 format.
Name string
Azure resource name
Type string
Azure resource type
Id string
The provider-assigned unique ID for this managed resource.
IsMigrated bool
the value indicating whether this alert rule is migrated.
LastUpdatedTime string
Last time the rule was updated in ISO8601 format.
Name string
Azure resource name
Type string
Azure resource type
id string
The provider-assigned unique ID for this managed resource.
isMigrated boolean
the value indicating whether this alert rule is migrated.
lastUpdatedTime string
Last time the rule was updated in ISO8601 format.
name string
Azure resource name
type string
Azure resource type
id str
The provider-assigned unique ID for this managed resource.
is_migrated bool
the value indicating whether this alert rule is migrated.
last_updated_time str
Last time the rule was updated in ISO8601 format.
name str
Azure resource name
type str
Azure resource type

Supporting Types

AggregationTypeEnum

Average
Average
Count
Count
Minimum
Minimum
Maximum
Maximum
Total
Total
AggregationTypeEnumAverage
Average
AggregationTypeEnumCount
Count
AggregationTypeEnumMinimum
Minimum
AggregationTypeEnumMaximum
Maximum
AggregationTypeEnumTotal
Total
Average
Average
Count
Count
Minimum
Minimum
Maximum
Maximum
Total
Total
AVERAGE
Average
COUNT
Count
MINIMUM
Minimum
MAXIMUM
Maximum
TOTAL
Total

DynamicMetricCriteria

AlertSensitivity string | Pulumi.AzureNative.Insights.DynamicThresholdSensitivity
The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
FailingPeriods Pulumi.AzureNative.Insights.Inputs.DynamicThresholdFailingPeriods
The minimum number of violations required within the selected lookback time window required to raise an alert.
MetricName string
Name of the metric.
Name string
Name of the criteria.
Operator string | Pulumi.AzureNative.Insights.DynamicThresholdOperator
The operator used to compare the metric value against the threshold.
TimeAggregation string | Pulumi.AzureNative.Insights.AggregationTypeEnum
the criteria time aggregation types.
Dimensions List<Pulumi.AzureNative.Insights.Inputs.MetricDimension>
List of dimension conditions.
IgnoreDataBefore string
Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
MetricNamespace string
Namespace of the metric.
SkipMetricValidation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
AlertSensitivity string | DynamicThresholdSensitivity
The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
FailingPeriods DynamicThresholdFailingPeriods
The minimum number of violations required within the selected lookback time window required to raise an alert.
MetricName string
Name of the metric.
Name string
Name of the criteria.
Operator string | DynamicThresholdOperator
The operator used to compare the metric value against the threshold.
TimeAggregation string | AggregationTypeEnum
the criteria time aggregation types.
Dimensions []MetricDimension
List of dimension conditions.
IgnoreDataBefore string
Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
MetricNamespace string
Namespace of the metric.
SkipMetricValidation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
alertSensitivity string | DynamicThresholdSensitivity
The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
failingPeriods DynamicThresholdFailingPeriods
The minimum number of violations required within the selected lookback time window required to raise an alert.
metricName string
Name of the metric.
name string
Name of the criteria.
operator string | DynamicThresholdOperator
The operator used to compare the metric value against the threshold.
timeAggregation string | AggregationTypeEnum
the criteria time aggregation types.
dimensions MetricDimension[]
List of dimension conditions.
ignoreDataBefore string
Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
metricNamespace string
Namespace of the metric.
skipMetricValidation boolean
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
alert_sensitivity str | DynamicThresholdSensitivity
The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
failing_periods DynamicThresholdFailingPeriods
The minimum number of violations required within the selected lookback time window required to raise an alert.
metric_name str
Name of the metric.
name str
Name of the criteria.
operator str | DynamicThresholdOperator
The operator used to compare the metric value against the threshold.
time_aggregation str | AggregationTypeEnum
the criteria time aggregation types.
dimensions Sequence[MetricDimension]
List of dimension conditions.
ignore_data_before str
Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
metric_namespace str
Namespace of the metric.
skip_metric_validation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.

DynamicMetricCriteriaResponse

AlertSensitivity string
The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
FailingPeriods Pulumi.AzureNative.Insights.Inputs.DynamicThresholdFailingPeriodsResponse
The minimum number of violations required within the selected lookback time window required to raise an alert.
MetricName string
Name of the metric.
Name string
Name of the criteria.
Operator string
The operator used to compare the metric value against the threshold.
TimeAggregation string
the criteria time aggregation types.
Dimensions List<Pulumi.AzureNative.Insights.Inputs.MetricDimensionResponse>
List of dimension conditions.
IgnoreDataBefore string
Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
MetricNamespace string
Namespace of the metric.
SkipMetricValidation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
AlertSensitivity string
The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
FailingPeriods DynamicThresholdFailingPeriodsResponse
The minimum number of violations required within the selected lookback time window required to raise an alert.
MetricName string
Name of the metric.
Name string
Name of the criteria.
Operator string
The operator used to compare the metric value against the threshold.
TimeAggregation string
the criteria time aggregation types.
Dimensions []MetricDimensionResponse
List of dimension conditions.
IgnoreDataBefore string
Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
MetricNamespace string
Namespace of the metric.
SkipMetricValidation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
alertSensitivity string
The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
failingPeriods DynamicThresholdFailingPeriodsResponse
The minimum number of violations required within the selected lookback time window required to raise an alert.
metricName string
Name of the metric.
name string
Name of the criteria.
operator string
The operator used to compare the metric value against the threshold.
timeAggregation string
the criteria time aggregation types.
dimensions MetricDimensionResponse[]
List of dimension conditions.
ignoreDataBefore string
Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
metricNamespace string
Namespace of the metric.
skipMetricValidation boolean
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
alert_sensitivity str
The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.
failing_periods DynamicThresholdFailingPeriodsResponse
The minimum number of violations required within the selected lookback time window required to raise an alert.
metric_name str
Name of the metric.
name str
Name of the criteria.
operator str
The operator used to compare the metric value against the threshold.
time_aggregation str
the criteria time aggregation types.
dimensions Sequence[MetricDimensionResponse]
List of dimension conditions.
ignore_data_before str
Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format)
metric_namespace str
Namespace of the metric.
skip_metric_validation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.

DynamicThresholdFailingPeriods

MinFailingPeriodsToAlert double
The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
NumberOfEvaluationPeriods double
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.
MinFailingPeriodsToAlert float64
The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
NumberOfEvaluationPeriods float64
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.
minFailingPeriodsToAlert number
The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
numberOfEvaluationPeriods number
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.
min_failing_periods_to_alert float
The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
number_of_evaluation_periods float
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.

DynamicThresholdFailingPeriodsResponse

MinFailingPeriodsToAlert double
The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
NumberOfEvaluationPeriods double
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.
MinFailingPeriodsToAlert float64
The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
NumberOfEvaluationPeriods float64
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.
minFailingPeriodsToAlert number
The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
numberOfEvaluationPeriods number
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.
min_failing_periods_to_alert float
The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods.
number_of_evaluation_periods float
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.

DynamicThresholdOperator

GreaterThan
GreaterThan
LessThan
LessThan
GreaterOrLessThan
GreaterOrLessThan
DynamicThresholdOperatorGreaterThan
GreaterThan
DynamicThresholdOperatorLessThan
LessThan
DynamicThresholdOperatorGreaterOrLessThan
GreaterOrLessThan
GreaterThan
GreaterThan
LessThan
LessThan
GreaterOrLessThan
GreaterOrLessThan
GREATER_THAN
GreaterThan
LESS_THAN
LessThan
GREATER_OR_LESS_THAN
GreaterOrLessThan

DynamicThresholdSensitivity

Low
Low
Medium
Medium
High
High
DynamicThresholdSensitivityLow
Low
DynamicThresholdSensitivityMedium
Medium
DynamicThresholdSensitivityHigh
High
Low
Low
Medium
Medium
High
High
LOW
Low
MEDIUM
Medium
HIGH
High

MetricAlertAction

ActionGroupId string
the id of the action group to use.
WebHookProperties Dictionary<string, string>
This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
ActionGroupId string
the id of the action group to use.
WebHookProperties map[string]string
This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
actionGroupId string
the id of the action group to use.
webHookProperties {[key: string]: string}
This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
action_group_id str
the id of the action group to use.
web_hook_properties Mapping[str, str]
This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.

MetricAlertActionResponse

ActionGroupId string
the id of the action group to use.
WebHookProperties Dictionary<string, string>
This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
ActionGroupId string
the id of the action group to use.
WebHookProperties map[string]string
This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
actionGroupId string
the id of the action group to use.
webHookProperties {[key: string]: string}
This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.
action_group_id str
the id of the action group to use.
web_hook_properties Mapping[str, str]
This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook.

MetricAlertMultipleResourceMultipleMetricCriteria

AllOf List<Union<Pulumi.AzureNative.Insights.Inputs.DynamicMetricCriteria, Pulumi.AzureNative.Insights.Inputs.MetricCriteria>>
the list of multiple metric criteria for this ‘all of’ operation.
AllOf []interface{}
the list of multiple metric criteria for this ‘all of’ operation.
allOf (DynamicMetricCriteria | MetricCriteria)[]
the list of multiple metric criteria for this ‘all of’ operation.
all_of Sequence[Union[DynamicMetricCriteria, MetricCriteria]]
the list of multiple metric criteria for this ‘all of’ operation.

MetricAlertMultipleResourceMultipleMetricCriteriaResponse

AllOf List<Union<Pulumi.AzureNative.Insights.Inputs.DynamicMetricCriteriaResponse, Pulumi.AzureNative.Insights.Inputs.MetricCriteriaResponse>>
the list of multiple metric criteria for this ‘all of’ operation.
AllOf []interface{}
the list of multiple metric criteria for this ‘all of’ operation.
allOf (DynamicMetricCriteriaResponse | MetricCriteriaResponse)[]
the list of multiple metric criteria for this ‘all of’ operation.
all_of Sequence[Union[DynamicMetricCriteriaResponse, MetricCriteriaResponse]]
the list of multiple metric criteria for this ‘all of’ operation.

MetricAlertSingleResourceMultipleMetricCriteria

AllOf List<Pulumi.AzureNative.Insights.Inputs.MetricCriteria>
The list of metric criteria for this ‘all of’ operation.
AllOf []MetricCriteria
The list of metric criteria for this ‘all of’ operation.
allOf MetricCriteria[]
The list of metric criteria for this ‘all of’ operation.
all_of Sequence[MetricCriteria]
The list of metric criteria for this ‘all of’ operation.

MetricAlertSingleResourceMultipleMetricCriteriaResponse

AllOf List<Pulumi.AzureNative.Insights.Inputs.MetricCriteriaResponse>
The list of metric criteria for this ‘all of’ operation.
AllOf []MetricCriteriaResponse
The list of metric criteria for this ‘all of’ operation.
allOf MetricCriteriaResponse[]
The list of metric criteria for this ‘all of’ operation.
all_of Sequence[MetricCriteriaResponse]
The list of metric criteria for this ‘all of’ operation.

MetricCriteria

MetricName string
Name of the metric.
Name string
Name of the criteria.
Operator string | Pulumi.AzureNative.Insights.Operator
the criteria operator.
Threshold double
the criteria threshold value that activates the alert.
TimeAggregation string | Pulumi.AzureNative.Insights.AggregationTypeEnum
the criteria time aggregation types.
Dimensions List<Pulumi.AzureNative.Insights.Inputs.MetricDimension>
List of dimension conditions.
MetricNamespace string
Namespace of the metric.
SkipMetricValidation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
MetricName string
Name of the metric.
Name string
Name of the criteria.
Operator string | Operator
the criteria operator.
Threshold float64
the criteria threshold value that activates the alert.
TimeAggregation string | AggregationTypeEnum
the criteria time aggregation types.
Dimensions []MetricDimension
List of dimension conditions.
MetricNamespace string
Namespace of the metric.
SkipMetricValidation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
metricName string
Name of the metric.
name string
Name of the criteria.
operator string | Operator
the criteria operator.
threshold number
the criteria threshold value that activates the alert.
timeAggregation string | AggregationTypeEnum
the criteria time aggregation types.
dimensions MetricDimension[]
List of dimension conditions.
metricNamespace string
Namespace of the metric.
skipMetricValidation boolean
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
metric_name str
Name of the metric.
name str
Name of the criteria.
operator str | Operator
the criteria operator.
threshold float
the criteria threshold value that activates the alert.
time_aggregation str | AggregationTypeEnum
the criteria time aggregation types.
dimensions Sequence[MetricDimension]
List of dimension conditions.
metric_namespace str
Namespace of the metric.
skip_metric_validation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.

MetricCriteriaResponse

MetricName string
Name of the metric.
Name string
Name of the criteria.
Operator string
the criteria operator.
Threshold double
the criteria threshold value that activates the alert.
TimeAggregation string
the criteria time aggregation types.
Dimensions List<Pulumi.AzureNative.Insights.Inputs.MetricDimensionResponse>
List of dimension conditions.
MetricNamespace string
Namespace of the metric.
SkipMetricValidation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
MetricName string
Name of the metric.
Name string
Name of the criteria.
Operator string
the criteria operator.
Threshold float64
the criteria threshold value that activates the alert.
TimeAggregation string
the criteria time aggregation types.
Dimensions []MetricDimensionResponse
List of dimension conditions.
MetricNamespace string
Namespace of the metric.
SkipMetricValidation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
metricName string
Name of the metric.
name string
Name of the criteria.
operator string
the criteria operator.
threshold number
the criteria threshold value that activates the alert.
timeAggregation string
the criteria time aggregation types.
dimensions MetricDimensionResponse[]
List of dimension conditions.
metricNamespace string
Namespace of the metric.
skipMetricValidation boolean
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.
metric_name str
Name of the metric.
name str
Name of the criteria.
operator str
the criteria operator.
threshold float
the criteria threshold value that activates the alert.
time_aggregation str
the criteria time aggregation types.
dimensions Sequence[MetricDimensionResponse]
List of dimension conditions.
metric_namespace str
Namespace of the metric.
skip_metric_validation bool
Allows creating an alert rule on a custom metric that isn’t yet emitted, by causing the metric validation to be skipped.

MetricDimension

Name string
Name of the dimension.
Operator string
the dimension operator. Only ‘Include’ and ‘Exclude’ are supported
Values List<string>
list of dimension values.
Name string
Name of the dimension.
Operator string
the dimension operator. Only ‘Include’ and ‘Exclude’ are supported
Values []string
list of dimension values.
name string
Name of the dimension.
operator string
the dimension operator. Only ‘Include’ and ‘Exclude’ are supported
values string[]
list of dimension values.
name str
Name of the dimension.
operator str
the dimension operator. Only ‘Include’ and ‘Exclude’ are supported
values Sequence[str]
list of dimension values.

MetricDimensionResponse

Name string
Name of the dimension.
Operator string
the dimension operator. Only ‘Include’ and ‘Exclude’ are supported
Values List<string>
list of dimension values.
Name string
Name of the dimension.
Operator string
the dimension operator. Only ‘Include’ and ‘Exclude’ are supported
Values []string
list of dimension values.
name string
Name of the dimension.
operator string
the dimension operator. Only ‘Include’ and ‘Exclude’ are supported
values string[]
list of dimension values.
name str
Name of the dimension.
operator str
the dimension operator. Only ‘Include’ and ‘Exclude’ are supported
values Sequence[str]
list of dimension values.

Operator

Include
Include
OperatorInclude
Include
Include
Include
INCLUDE
Include

WebtestLocationAvailabilityCriteria

ComponentId string
The Application Insights resource Id.
FailedLocationCount double
The number of failed locations.
WebTestId string
The Application Insights web test Id.
ComponentId string
The Application Insights resource Id.
FailedLocationCount float64
The number of failed locations.
WebTestId string
The Application Insights web test Id.
componentId string
The Application Insights resource Id.
failedLocationCount number
The number of failed locations.
webTestId string
The Application Insights web test Id.
component_id str
The Application Insights resource Id.
failed_location_count float
The number of failed locations.
web_test_id str
The Application Insights web test Id.

WebtestLocationAvailabilityCriteriaResponse

ComponentId string
The Application Insights resource Id.
FailedLocationCount double
The number of failed locations.
WebTestId string
The Application Insights web test Id.
ComponentId string
The Application Insights resource Id.
FailedLocationCount float64
The number of failed locations.
WebTestId string
The Application Insights web test Id.
componentId string
The Application Insights resource Id.
failedLocationCount number
The number of failed locations.
webTestId string
The Application Insights web test Id.
component_id str
The Application Insights resource Id.
failed_location_count float
The number of failed locations.
web_test_id str
The Application Insights web test Id.

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:insights:MetricAlert webtest-name-example /subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/providers/microsoft.insights/metricalerts/MetricAlertWithDimensions 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0