azure-native.insights.MetricAlert

Explore with Pulumi AI

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

Example Usage

Create or update a dynamic alert rule for Multiple Resources

using System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
    {
        Actions = new[]
        {
            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[]
            {
                new AzureNative.Insights.Inputs.DynamicMetricCriteriaArgs
                {
                    AlertSensitivity = "Medium",
                    CriterionType = "DynamicThresholdCriterion",
                    Dimensions = new[] {},
                    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 = new[]
        {
            "/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 = null,
        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{
				{
					ActionGroupId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: {
						"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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()        
            .actions(Map.ofEntries(
                Map.entry("actionGroupId", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
                Map.entry("webHookProperties", Map.ofEntries(
                    Map.entry("key11", "value11"),
                    Map.entry("key12", "value12")
                ))
            ))
            .autoMitigate(true)
            .criteria(Map.ofEntries(
                Map.entry("allOf", Map.ofEntries(
                    Map.entry("alertSensitivity", "Medium"),
                    Map.entry("criterionType", "DynamicThresholdCriterion"),
                    Map.entry("dimensions", ),
                    Map.entry("failingPeriods", Map.ofEntries(
                        Map.entry("minFailingPeriodsToAlert", 4),
                        Map.entry("numberOfEvaluationPeriods", 4)
                    )),
                    Map.entry("metricName", "Percentage CPU"),
                    Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
                    Map.entry("name", "High_CPU_80"),
                    Map.entry("operator", "GreaterOrLessThan"),
                    Map.entry("timeAggregation", "Average")
                )),
                Map.entry("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")
            .build());

    }
}
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",
});
resources:
  metricAlert:
    type: azure-native:insights:MetricAlert
    properties:
      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 System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
    {
        Actions = new[]
        {
            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[]
            {
                new AzureNative.Insights.Inputs.DynamicMetricCriteriaArgs
                {
                    AlertSensitivity = "Medium",
                    CriterionType = "DynamicThresholdCriterion",
                    Dimensions = new[] {},
                    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 = new[]
        {
            "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme",
        },
        Severity = 3,
        Tags = null,
        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{
				{
					ActionGroupId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: {
						"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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()        
            .actions(Map.ofEntries(
                Map.entry("actionGroupId", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
                Map.entry("webHookProperties", Map.ofEntries(
                    Map.entry("key11", "value11"),
                    Map.entry("key12", "value12")
                ))
            ))
            .autoMitigate(true)
            .criteria(Map.ofEntries(
                Map.entry("allOf", Map.ofEntries(
                    Map.entry("alertSensitivity", "Medium"),
                    Map.entry("criterionType", "DynamicThresholdCriterion"),
                    Map.entry("dimensions", ),
                    Map.entry("failingPeriods", Map.ofEntries(
                        Map.entry("minFailingPeriodsToAlert", 4),
                        Map.entry("numberOfEvaluationPeriods", 4)
                    )),
                    Map.entry("ignoreDataBefore", "2019-04-04T21:00:00.000Z"),
                    Map.entry("metricName", "Percentage CPU"),
                    Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
                    Map.entry("name", "High_CPU_80"),
                    Map.entry("operator", "GreaterOrLessThan"),
                    Map.entry("timeAggregation", "Average")
                )),
                Map.entry("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")
            .build());

    }
}
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",
});
resources:
  metricAlert:
    type: azure-native:insights:MetricAlert
    properties:
      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 System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
    {
        Actions = new[] {},
        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 = new[]
        {
            "/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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()        
            .actions()
            .criteria(Map.ofEntries(
                Map.entry("componentId", "/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example"),
                Map.entry("failedLocationCount", 2),
                Map.entry("odataType", "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"),
                Map.entry("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(Map.ofEntries(
                Map.entry("hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", "Resource"),
                Map.entry("hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", "Resource")
            ))
            .windowSize("PT15M")
            .build());

    }
}
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",
});
resources:
  metricAlert:
    type: azure-native:insights:MetricAlert
    properties:
      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 System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
    {
        Actions = new[]
        {
            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[]
            {
                new AzureNative.Insights.Inputs.MetricCriteriaArgs
                {
                    CriterionType = "StaticThresholdCriterion",
                    Dimensions = new[] {},
                    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 = new[]
        {
            "/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 = null,
        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{
				{
					ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: {
						"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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()        
            .actions(Map.ofEntries(
                Map.entry("actionGroupId", "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
                Map.entry("webHookProperties", Map.ofEntries(
                    Map.entry("key11", "value11"),
                    Map.entry("key12", "value12")
                ))
            ))
            .autoMitigate(true)
            .criteria(Map.ofEntries(
                Map.entry("allOf", Map.ofEntries(
                    Map.entry("criterionType", "StaticThresholdCriterion"),
                    Map.entry("dimensions", ),
                    Map.entry("metricName", "Percentage CPU"),
                    Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
                    Map.entry("name", "High_CPU_80"),
                    Map.entry("operator", "GreaterThan"),
                    Map.entry("threshold", 80.5),
                    Map.entry("timeAggregation", "Average")
                )),
                Map.entry("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")
            .build());

    }
}
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",
});
resources:
  metricAlert:
    type: azure-native:insights:MetricAlert
    properties:
      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 System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
    {
        Actions = new[]
        {
            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[]
            {
                new AzureNative.Insights.Inputs.MetricCriteriaArgs
                {
                    CriterionType = "StaticThresholdCriterion",
                    Dimensions = new[] {},
                    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 = new[]
        {
            "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.Compute/virtualMachines/gigwadme",
        },
        Severity = 3,
        Tags = null,
        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{
				{
					ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: {
						"key11": pulumi.String("value11"),
						"key12": pulumi.String("value12"),
					},
				},
			},
			AutoMitigate: pulumi.Bool(true),
			Criteria: insights.MetricAlertSingleResourceMultipleMetricCriteria{
				AllOf: []insights.MetricCriteria{
					{
						CriterionType:   "StaticThresholdCriterion",
						Dimensions:      []insights.MetricDimension{},
						MetricName:      fmt.Sprintf("\\Processor(_Total)\\%v 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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()        
            .actions(Map.ofEntries(
                Map.entry("actionGroupId", "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
                Map.entry("webHookProperties", Map.ofEntries(
                    Map.entry("key11", "value11"),
                    Map.entry("key12", "value12")
                ))
            ))
            .autoMitigate(true)
            .criteria(Map.ofEntries(
                Map.entry("allOf", Map.ofEntries(
                    Map.entry("criterionType", "StaticThresholdCriterion"),
                    Map.entry("dimensions", ),
                    Map.entry("metricName", "\\Processor(_Total)\\% Processor Time"),
                    Map.entry("name", "High_CPU_80"),
                    Map.entry("operator", "GreaterThan"),
                    Map.entry("threshold", 80.5),
                    Map.entry("timeAggregation", "Average")
                )),
                Map.entry("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")
            .build());

    }
}
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",
});
resources:
  metricAlert:
    type: azure-native:insights:MetricAlert
    properties:
      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 System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
    {
        Actions = new[]
        {
            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[]
            {
                new AzureNative.Insights.Inputs.MetricCriteriaArgs
                {
                    CriterionType = "StaticThresholdCriterion",
                    Dimensions = new[] {},
                    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 = new[]
        {
            "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest1",
            "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest2",
        },
        Severity = 3,
        Tags = null,
        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{
				{
					ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: {
						"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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()        
            .actions(Map.ofEntries(
                Map.entry("actionGroupId", "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
                Map.entry("webHookProperties", Map.ofEntries(
                    Map.entry("key11", "value11"),
                    Map.entry("key12", "value12")
                ))
            ))
            .autoMitigate(true)
            .criteria(Map.ofEntries(
                Map.entry("allOf", Map.ofEntries(
                    Map.entry("criterionType", "StaticThresholdCriterion"),
                    Map.entry("dimensions", ),
                    Map.entry("metricName", "Percentage CPU"),
                    Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
                    Map.entry("name", "High_CPU_80"),
                    Map.entry("operator", "GreaterThan"),
                    Map.entry("threshold", 80.5),
                    Map.entry("timeAggregation", "Average")
                )),
                Map.entry("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")
            .build());

    }
}
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",
});
resources:
  metricAlert:
    type: azure-native:insights:MetricAlert
    properties:
      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 System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
    {
        Actions = new[]
        {
            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[]
            {
                new AzureNative.Insights.Inputs.MetricCriteriaArgs
                {
                    CriterionType = "StaticThresholdCriterion",
                    Dimensions = new[] {},
                    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 = new[]
        {
            "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7",
        },
        Severity = 3,
        Tags = null,
        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{
				{
					ActionGroupId: pulumi.String("/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: {
						"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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()        
            .actions(Map.ofEntries(
                Map.entry("actionGroupId", "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
                Map.entry("webHookProperties", Map.ofEntries(
                    Map.entry("key11", "value11"),
                    Map.entry("key12", "value12")
                ))
            ))
            .autoMitigate(true)
            .criteria(Map.ofEntries(
                Map.entry("allOf", Map.ofEntries(
                    Map.entry("criterionType", "StaticThresholdCriterion"),
                    Map.entry("dimensions", ),
                    Map.entry("metricName", "Percentage CPU"),
                    Map.entry("metricNamespace", "microsoft.compute/virtualmachines"),
                    Map.entry("name", "High_CPU_80"),
                    Map.entry("operator", "GreaterThan"),
                    Map.entry("threshold", 80.5),
                    Map.entry("timeAggregation", "Average")
                )),
                Map.entry("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")
            .build());

    }
}
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",
});
resources:
  metricAlert:
    type: azure-native:insights:MetricAlert
    properties:
      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 System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var metricAlert = new AzureNative.Insights.MetricAlert("metricAlert", new()
    {
        Actions = new[]
        {
            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[]
            {
                new AzureNative.Insights.Inputs.MetricCriteriaArgs
                {
                    CriterionType = "StaticThresholdCriterion",
                    Dimensions = new[]
                    {
                        new AzureNative.Insights.Inputs.MetricDimensionArgs
                        {
                            Name = "ActivityName",
                            Operator = "Include",
                            Values = new[]
                            {
                                "*",
                            },
                        },
                        new AzureNative.Insights.Inputs.MetricDimensionArgs
                        {
                            Name = "StatusCode",
                            Operator = "Include",
                            Values = new[]
                            {
                                "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 = new[]
        {
            "/subscriptions/14ddf0c5-77c5-4b53-84f6-e1fa43ad68f7/resourceGroups/gigtest/providers/Microsoft.KeyVault/vaults/keyVaultResource",
        },
        Severity = 3,
        Tags = null,
        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{
				{
					ActionGroupId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
					WebHookProperties: {
						"key11": pulumi.String("value11"),
						"key12": pulumi.String("value12"),
					},
				},
			},
			AutoMitigate: pulumi.Bool(true),
			Criteria: insights.MetricAlertMultipleResourceMultipleMetricCriteria{
				AllOf: []interface{}{
					insights.MetricCriteria{
						CriterionType: "StaticThresholdCriterion",
						Dimensions: []insights.MetricDimension{
							{
								Name:     "ActivityName",
								Operator: "Include",
								Values: []string{
									"*",
								},
							},
							{
								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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.insights.MetricAlert;
import com.pulumi.azurenative.insights.MetricAlertArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var metricAlert = new MetricAlert("metricAlert", MetricAlertArgs.builder()        
            .actions(Map.ofEntries(
                Map.entry("actionGroupId", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/gigtest/providers/microsoft.insights/actiongroups/group2"),
                Map.entry("webHookProperties", Map.ofEntries(
                    Map.entry("key11", "value11"),
                    Map.entry("key12", "value12")
                ))
            ))
            .autoMitigate(true)
            .criteria(Map.ofEntries(
                Map.entry("allOf", Map.ofEntries(
                    Map.entry("criterionType", "StaticThresholdCriterion"),
                    Map.entry("dimensions",                     
                        Map.ofEntries(
                            Map.entry("name", "ActivityName"),
                            Map.entry("operator", "Include"),
                            Map.entry("values", "*")
                        ),
                        Map.ofEntries(
                            Map.entry("name", "StatusCode"),
                            Map.entry("operator", "Include"),
                            Map.entry("values", "200")
                        )),
                    Map.entry("metricName", "Availability"),
                    Map.entry("metricNamespace", "Microsoft.KeyVault/vaults"),
                    Map.entry("name", "Metric1"),
                    Map.entry("operator", "GreaterThan"),
                    Map.entry("threshold", 55),
                    Map.entry("timeAggregation", "Average")
                )),
                Map.entry("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")
            .build());

    }
}
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",
});
resources:
  metricAlert:
    type: azure-native:insights:MetricAlert
    properties:
      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 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)
public MetricAlert(String name, MetricAlertArgs args)
public MetricAlert(String name, MetricAlertArgs args, CustomResourceOptions options)
type: azure-native:insights:MetricAlert
properties: # The arguments to resource properties.
options: # 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.
resource_name str
The unique name of the resource.
args MetricAlertArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args MetricAlertArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MetricAlertArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args MetricAlertArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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. The name is case insensitive.

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. The name is case insensitive.

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. The name is case insensitive.

scopes List<String>

the list of resource id's that this metric alert is scoped to.

severity Integer

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<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 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. The name is case insensitive.

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. The name is case insensitive.

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.

criteria Property Map | Property Map | Property Map

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. The name is case insensitive.

scopes List<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 List<Property Map>

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 Map<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.

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 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

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

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
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 List<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.

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.

alertSensitivity String | "Low" | "Medium" | "High"

The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern.

failingPeriods Property Map

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 | "GreaterThan" | "LessThan" | "GreaterOrLessThan"

The operator used to compare the metric value against the threshold.

timeAggregation String | "Average" | "Count" | "Minimum" | "Maximum" | "Total"

the criteria time aggregation types.

dimensions List<Property Map>

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.

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 List<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.

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.

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 Property Map

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<Property Map>

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.

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 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 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.

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.

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 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 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.

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.

DynamicThresholdOperator

GreaterThan
GreaterThan
LessThan
LessThan
GreaterOrLessThan
GreaterOrLessThan
DynamicThresholdOperatorGreaterThan
GreaterThan
DynamicThresholdOperatorLessThan
LessThan
DynamicThresholdOperatorGreaterOrLessThan
GreaterOrLessThan
GreaterThan
GreaterThan
LessThan
LessThan
GreaterOrLessThan
GreaterOrLessThan
GreaterThan
GreaterThan
LessThan
LessThan
GreaterOrLessThan
GreaterOrLessThan
GREATER_THAN
GreaterThan
LESS_THAN
LessThan
GREATER_OR_LESS_THAN
GreaterOrLessThan
"GreaterThan"
GreaterThan
"LessThan"
LessThan
"GreaterOrLessThan"
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
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 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.

actionGroupId String

the id of the action group to use.

webHookProperties Map<String>

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 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.

actionGroupId String

the id of the action group to use.

webHookProperties Map<String>

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 List<Either<DynamicMetricCriteria,MetricCriteria>>

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.

allOf List<Property Map | Property Map>

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 List<Either<DynamicMetricCriteriaResponse,MetricCriteriaResponse>>

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.

allOf List<Property Map | Property Map>

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 List<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.

allOf List<Property Map>

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 List<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.

allOf List<Property Map>

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 Double

the criteria threshold value that activates the alert.

timeAggregation String | AggregationTypeEnum

the criteria time aggregation types.

dimensions List<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.

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.

metricName String

Name of the metric.

name String

Name of the criteria.

operator String | "Include"

the criteria operator.

threshold Number

the criteria threshold value that activates the alert.

timeAggregation String | "Average" | "Count" | "Minimum" | "Maximum" | "Total"

the criteria time aggregation types.

dimensions List<Property Map>

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.

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 Double

the criteria threshold value that activates the alert.

timeAggregation String

the criteria time aggregation types.

dimensions List<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.

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.

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 List<Property Map>

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.

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 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 str

Name of the dimension.

operator str

the dimension operator. Only 'Include' and 'Exclude' are supported

values Sequence[str]

list of dimension values.

name String

Name of the dimension.

operator String

the dimension operator. Only 'Include' and 'Exclude' are supported

values List<String>

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 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 str

Name of the dimension.

operator str

the dimension operator. Only 'Include' and 'Exclude' are supported

values Sequence[str]

list of dimension values.

name String

Name of the dimension.

operator String

the dimension operator. Only 'Include' and 'Exclude' are supported

values List<String>

list of dimension values.

Operator

Include
Include
OperatorInclude
Include
Include
Include
Include
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 Double

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.

componentId String

The Application Insights resource Id.

failedLocationCount Number

The number of failed locations.

webTestId String

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 Double

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.

componentId String

The Application Insights resource Id.

failedLocationCount Number

The number of failed locations.

webTestId String

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
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0