1. Packages
  2. Azure Classic
  3. API Docs
  4. monitoring
  5. ScheduledQueryRulesAlert

We recommend using Azure Native.

Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi
azure logo

We recommend using Azure Native.

Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi

    Manages an AlertingAction Scheduled Query Rules resource within Azure Monitor.

    Note: This resource is using an older AzureRM API version which is known to cause problems e.g. with custom webhook properties not included in triggered alerts. This resource is superseded by the azure.monitoring.ScheduledQueryRulesAlertV2 resource using newer API versions.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    import * as std from "@pulumi/std";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "monitoring-resources",
        location: "West Europe",
    });
    const exampleInsights = new azure.appinsights.Insights("example", {
        name: "appinsights",
        location: example.location,
        resourceGroupName: example.name,
        applicationType: "web",
    });
    const example2 = new azure.appinsights.Insights("example2", {
        name: "appinsights2",
        location: example.location,
        resourceGroupName: example.name,
        applicationType: "web",
    });
    // Example: Alerting Action with result count trigger
    const exampleScheduledQueryRulesAlert = new azure.monitoring.ScheduledQueryRulesAlert("example", {
        name: "example",
        location: example.location,
        resourceGroupName: example.name,
        action: {
            actionGroups: [],
            emailSubject: "Email Header",
            customWebhookPayload: "{}",
        },
        dataSourceId: exampleInsights.id,
        description: "Alert when total results cross threshold",
        enabled: true,
        query: `requests
      | where tolong(resultCode) >= 500
      | summarize count() by bin(timestamp, 5m)
    `,
        severity: 1,
        frequency: 5,
        timeWindow: 30,
        trigger: {
            operator: "GreaterThan",
            threshold: 3,
        },
        tags: {
            foo: "bar",
        },
    });
    // Example: Alerting Action Cross-Resource
    const example2ScheduledQueryRulesAlert = new azure.monitoring.ScheduledQueryRulesAlert("example2", {
        name: "example",
        location: example.location,
        resourceGroupName: example.name,
        authorizedResourceIds: [example2.id],
        action: {
            actionGroups: [],
            emailSubject: "Email Header",
            customWebhookPayload: "{}",
        },
        dataSourceId: exampleInsights.id,
        description: "Query may access data within multiple resources",
        enabled: true,
        query: std.format({
            input: `let a=requests
      | where toint(resultCode) >= 500
      | extend fail=1; let b=app('%s').requests
      | where toint(resultCode) >= 500 | extend fail=1; a
      | join b on fail
    `,
            args: [example2.id],
        }).then(invoke => invoke.result),
        severity: 1,
        frequency: 5,
        timeWindow: 30,
        trigger: {
            operator: "GreaterThan",
            threshold: 3,
        },
        tags: {
            foo: "bar",
        },
    });
    
    import pulumi
    import pulumi_azure as azure
    import pulumi_std as std
    
    example = azure.core.ResourceGroup("example",
        name="monitoring-resources",
        location="West Europe")
    example_insights = azure.appinsights.Insights("example",
        name="appinsights",
        location=example.location,
        resource_group_name=example.name,
        application_type="web")
    example2 = azure.appinsights.Insights("example2",
        name="appinsights2",
        location=example.location,
        resource_group_name=example.name,
        application_type="web")
    # Example: Alerting Action with result count trigger
    example_scheduled_query_rules_alert = azure.monitoring.ScheduledQueryRulesAlert("example",
        name="example",
        location=example.location,
        resource_group_name=example.name,
        action={
            "action_groups": [],
            "email_subject": "Email Header",
            "custom_webhook_payload": "{}",
        },
        data_source_id=example_insights.id,
        description="Alert when total results cross threshold",
        enabled=True,
        query="""requests
      | where tolong(resultCode) >= 500
      | summarize count() by bin(timestamp, 5m)
    """,
        severity=1,
        frequency=5,
        time_window=30,
        trigger={
            "operator": "GreaterThan",
            "threshold": 3,
        },
        tags={
            "foo": "bar",
        })
    # Example: Alerting Action Cross-Resource
    example2_scheduled_query_rules_alert = azure.monitoring.ScheduledQueryRulesAlert("example2",
        name="example",
        location=example.location,
        resource_group_name=example.name,
        authorized_resource_ids=[example2.id],
        action={
            "action_groups": [],
            "email_subject": "Email Header",
            "custom_webhook_payload": "{}",
        },
        data_source_id=example_insights.id,
        description="Query may access data within multiple resources",
        enabled=True,
        query=std.format(input="""let a=requests
      | where toint(resultCode) >= 500
      | extend fail=1; let b=app('%s').requests
      | where toint(resultCode) >= 500 | extend fail=1; a
      | join b on fail
    """,
            args=[example2.id]).result,
        severity=1,
        frequency=5,
        time_window=30,
        trigger={
            "operator": "GreaterThan",
            "threshold": 3,
        },
        tags={
            "foo": "bar",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appinsights"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/monitoring"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("monitoring-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleInsights, err := appinsights.NewInsights(ctx, "example", &appinsights.InsightsArgs{
    			Name:              pulumi.String("appinsights"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			ApplicationType:   pulumi.String("web"),
    		})
    		if err != nil {
    			return err
    		}
    		example2, err := appinsights.NewInsights(ctx, "example2", &appinsights.InsightsArgs{
    			Name:              pulumi.String("appinsights2"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			ApplicationType:   pulumi.String("web"),
    		})
    		if err != nil {
    			return err
    		}
    		// Example: Alerting Action with result count trigger
    		_, err = monitoring.NewScheduledQueryRulesAlert(ctx, "example", &monitoring.ScheduledQueryRulesAlertArgs{
    			Name:              pulumi.String("example"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			Action: &monitoring.ScheduledQueryRulesAlertActionArgs{
    				ActionGroups:         pulumi.StringArray{},
    				EmailSubject:         pulumi.String("Email Header"),
    				CustomWebhookPayload: pulumi.String("{}"),
    			},
    			DataSourceId: exampleInsights.ID(),
    			Description:  pulumi.String("Alert when total results cross threshold"),
    			Enabled:      pulumi.Bool(true),
    			Query:        pulumi.String("requests\n  | where tolong(resultCode) >= 500\n  | summarize count() by bin(timestamp, 5m)\n"),
    			Severity:     pulumi.Int(1),
    			Frequency:    pulumi.Int(5),
    			TimeWindow:   pulumi.Int(30),
    			Trigger: &monitoring.ScheduledQueryRulesAlertTriggerArgs{
    				Operator:  pulumi.String("GreaterThan"),
    				Threshold: pulumi.Float64(3),
    			},
    			Tags: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		invokeFormat, err := std.Format(ctx, &std.FormatArgs{
    			Input: `let a=requests
      | where toint(resultCode) >= 500
      | extend fail=1; let b=app('%s').requests
      | where toint(resultCode) >= 500 | extend fail=1; a
      | join b on fail
    `,
    			Args: pulumi.StringArray{
    				example2.ID(),
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Example: Alerting Action Cross-Resource
    		_, err = monitoring.NewScheduledQueryRulesAlert(ctx, "example2", &monitoring.ScheduledQueryRulesAlertArgs{
    			Name:              pulumi.String("example"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			AuthorizedResourceIds: pulumi.StringArray{
    				example2.ID(),
    			},
    			Action: &monitoring.ScheduledQueryRulesAlertActionArgs{
    				ActionGroups:         pulumi.StringArray{},
    				EmailSubject:         pulumi.String("Email Header"),
    				CustomWebhookPayload: pulumi.String("{}"),
    			},
    			DataSourceId: exampleInsights.ID(),
    			Description:  pulumi.String("Query may access data within multiple resources"),
    			Enabled:      pulumi.Bool(true),
    			Query:        pulumi.String(invokeFormat.Result),
    			Severity:     pulumi.Int(1),
    			Frequency:    pulumi.Int(5),
    			TimeWindow:   pulumi.Int(30),
    			Trigger: &monitoring.ScheduledQueryRulesAlertTriggerArgs{
    				Operator:  pulumi.String("GreaterThan"),
    				Threshold: pulumi.Float64(3),
    			},
    			Tags: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "monitoring-resources",
            Location = "West Europe",
        });
    
        var exampleInsights = new Azure.AppInsights.Insights("example", new()
        {
            Name = "appinsights",
            Location = example.Location,
            ResourceGroupName = example.Name,
            ApplicationType = "web",
        });
    
        var example2 = new Azure.AppInsights.Insights("example2", new()
        {
            Name = "appinsights2",
            Location = example.Location,
            ResourceGroupName = example.Name,
            ApplicationType = "web",
        });
    
        // Example: Alerting Action with result count trigger
        var exampleScheduledQueryRulesAlert = new Azure.Monitoring.ScheduledQueryRulesAlert("example", new()
        {
            Name = "example",
            Location = example.Location,
            ResourceGroupName = example.Name,
            Action = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertActionArgs
            {
                ActionGroups = new() { },
                EmailSubject = "Email Header",
                CustomWebhookPayload = "{}",
            },
            DataSourceId = exampleInsights.Id,
            Description = "Alert when total results cross threshold",
            Enabled = true,
            Query = @"requests
      | where tolong(resultCode) >= 500
      | summarize count() by bin(timestamp, 5m)
    ",
            Severity = 1,
            Frequency = 5,
            TimeWindow = 30,
            Trigger = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertTriggerArgs
            {
                Operator = "GreaterThan",
                Threshold = 3,
            },
            Tags = 
            {
                { "foo", "bar" },
            },
        });
    
        // Example: Alerting Action Cross-Resource
        var example2ScheduledQueryRulesAlert = new Azure.Monitoring.ScheduledQueryRulesAlert("example2", new()
        {
            Name = "example",
            Location = example.Location,
            ResourceGroupName = example.Name,
            AuthorizedResourceIds = new[]
            {
                example2.Id,
            },
            Action = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertActionArgs
            {
                ActionGroups = new() { },
                EmailSubject = "Email Header",
                CustomWebhookPayload = "{}",
            },
            DataSourceId = exampleInsights.Id,
            Description = "Query may access data within multiple resources",
            Enabled = true,
            Query = Std.Format.Invoke(new()
            {
                Input = @"let a=requests
      | where toint(resultCode) >= 500
      | extend fail=1; let b=app('%s').requests
      | where toint(resultCode) >= 500 | extend fail=1; a
      | join b on fail
    ",
                Args = new[]
                {
                    example2.Id,
                },
            }).Apply(invoke => invoke.Result),
            Severity = 1,
            Frequency = 5,
            TimeWindow = 30,
            Trigger = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertTriggerArgs
            {
                Operator = "GreaterThan",
                Threshold = 3,
            },
            Tags = 
            {
                { "foo", "bar" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.appinsights.Insights;
    import com.pulumi.azure.appinsights.InsightsArgs;
    import com.pulumi.azure.monitoring.ScheduledQueryRulesAlert;
    import com.pulumi.azure.monitoring.ScheduledQueryRulesAlertArgs;
    import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertActionArgs;
    import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertTriggerArgs;
    import com.pulumi.std.StdFunctions;
    import com.pulumi.std.inputs.FormatArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("monitoring-resources")
                .location("West Europe")
                .build());
    
            var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
                .name("appinsights")
                .location(example.location())
                .resourceGroupName(example.name())
                .applicationType("web")
                .build());
    
            var example2 = new Insights("example2", InsightsArgs.builder()
                .name("appinsights2")
                .location(example.location())
                .resourceGroupName(example.name())
                .applicationType("web")
                .build());
    
            // Example: Alerting Action with result count trigger
            var exampleScheduledQueryRulesAlert = new ScheduledQueryRulesAlert("exampleScheduledQueryRulesAlert", ScheduledQueryRulesAlertArgs.builder()
                .name("example")
                .location(example.location())
                .resourceGroupName(example.name())
                .action(ScheduledQueryRulesAlertActionArgs.builder()
                    .actionGroups()
                    .emailSubject("Email Header")
                    .customWebhookPayload("{}")
                    .build())
                .dataSourceId(exampleInsights.id())
                .description("Alert when total results cross threshold")
                .enabled(true)
                .query("""
    requests
      | where tolong(resultCode) >= 500
      | summarize count() by bin(timestamp, 5m)
                """)
                .severity(1)
                .frequency(5)
                .timeWindow(30)
                .trigger(ScheduledQueryRulesAlertTriggerArgs.builder()
                    .operator("GreaterThan")
                    .threshold(3.0)
                    .build())
                .tags(Map.of("foo", "bar"))
                .build());
    
            // Example: Alerting Action Cross-Resource
            var example2ScheduledQueryRulesAlert = new ScheduledQueryRulesAlert("example2ScheduledQueryRulesAlert", ScheduledQueryRulesAlertArgs.builder()
                .name("example")
                .location(example.location())
                .resourceGroupName(example.name())
                .authorizedResourceIds(example2.id())
                .action(ScheduledQueryRulesAlertActionArgs.builder()
                    .actionGroups()
                    .emailSubject("Email Header")
                    .customWebhookPayload("{}")
                    .build())
                .dataSourceId(exampleInsights.id())
                .description("Query may access data within multiple resources")
                .enabled(true)
                .query(StdFunctions.format(FormatArgs.builder()
                    .input("""
    let a=requests
      | where toint(resultCode) >= 500
      | extend fail=1; let b=app('%s').requests
      | where toint(resultCode) >= 500 | extend fail=1; a
      | join b on fail
                    """)
                    .args(example2.id())
                    .build()).result())
                .severity(1)
                .frequency(5)
                .timeWindow(30)
                .trigger(ScheduledQueryRulesAlertTriggerArgs.builder()
                    .operator("GreaterThan")
                    .threshold(3.0)
                    .build())
                .tags(Map.of("foo", "bar"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: monitoring-resources
          location: West Europe
      exampleInsights:
        type: azure:appinsights:Insights
        name: example
        properties:
          name: appinsights
          location: ${example.location}
          resourceGroupName: ${example.name}
          applicationType: web
      example2:
        type: azure:appinsights:Insights
        properties:
          name: appinsights2
          location: ${example.location}
          resourceGroupName: ${example.name}
          applicationType: web
      # Example: Alerting Action with result count trigger
      exampleScheduledQueryRulesAlert:
        type: azure:monitoring:ScheduledQueryRulesAlert
        name: example
        properties:
          name: example
          location: ${example.location}
          resourceGroupName: ${example.name}
          action:
            actionGroups: []
            emailSubject: Email Header
            customWebhookPayload: '{}'
          dataSourceId: ${exampleInsights.id}
          description: Alert when total results cross threshold
          enabled: true # Count all requests with server error result code grouped into 5-minute bins
          query: |
            requests
              | where tolong(resultCode) >= 500
              | summarize count() by bin(timestamp, 5m)        
          severity: 1
          frequency: 5
          timeWindow: 30
          trigger:
            operator: GreaterThan
            threshold: 3
          tags:
            foo: bar
      # Example: Alerting Action Cross-Resource
      example2ScheduledQueryRulesAlert:
        type: azure:monitoring:ScheduledQueryRulesAlert
        name: example2
        properties:
          name: example
          location: ${example.location}
          resourceGroupName: ${example.name}
          authorizedResourceIds:
            - ${example2.id}
          action:
            actionGroups: []
            emailSubject: Email Header
            customWebhookPayload: '{}'
          dataSourceId: ${exampleInsights.id}
          description: Query may access data within multiple resources
          enabled: true # Count requests in multiple log resources and group into 5-minute bins by HTTP operation
          query:
            fn::invoke:
              function: std:format
              arguments:
                input: |
                  let a=requests
                    | where toint(resultCode) >= 500
                    | extend fail=1; let b=app('%s').requests
                    | where toint(resultCode) >= 500 | extend fail=1; a
                    | join b on fail              
                args:
                  - ${example2.id}
              return: result
          severity: 1
          frequency: 5
          timeWindow: 30
          trigger:
            operator: GreaterThan
            threshold: 3
          tags:
            foo: bar
    

    API Providers

    This resource uses the following Azure API Providers:

    • Microsoft.Insights - 2018-04-16

    Create ScheduledQueryRulesAlert Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ScheduledQueryRulesAlert(name: string, args: ScheduledQueryRulesAlertArgs, opts?: CustomResourceOptions);
    @overload
    def ScheduledQueryRulesAlert(resource_name: str,
                                 args: ScheduledQueryRulesAlertArgs,
                                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def ScheduledQueryRulesAlert(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 action: Optional[ScheduledQueryRulesAlertActionArgs] = None,
                                 trigger: Optional[ScheduledQueryRulesAlertTriggerArgs] = None,
                                 time_window: Optional[int] = None,
                                 data_source_id: Optional[str] = None,
                                 resource_group_name: Optional[str] = None,
                                 query: Optional[str] = None,
                                 frequency: Optional[int] = None,
                                 name: Optional[str] = None,
                                 location: Optional[str] = None,
                                 enabled: Optional[bool] = None,
                                 query_type: Optional[str] = None,
                                 description: Optional[str] = None,
                                 severity: Optional[int] = None,
                                 tags: Optional[Mapping[str, str]] = None,
                                 throttling: Optional[int] = None,
                                 auto_mitigation_enabled: Optional[bool] = None,
                                 authorized_resource_ids: Optional[Sequence[str]] = None)
    func NewScheduledQueryRulesAlert(ctx *Context, name string, args ScheduledQueryRulesAlertArgs, opts ...ResourceOption) (*ScheduledQueryRulesAlert, error)
    public ScheduledQueryRulesAlert(string name, ScheduledQueryRulesAlertArgs args, CustomResourceOptions? opts = null)
    public ScheduledQueryRulesAlert(String name, ScheduledQueryRulesAlertArgs args)
    public ScheduledQueryRulesAlert(String name, ScheduledQueryRulesAlertArgs args, CustomResourceOptions options)
    
    type: azure:monitoring:ScheduledQueryRulesAlert
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ScheduledQueryRulesAlertArgs
    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 ScheduledQueryRulesAlertArgs
    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 ScheduledQueryRulesAlertArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ScheduledQueryRulesAlertArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ScheduledQueryRulesAlertArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var scheduledQueryRulesAlertResource = new Azure.Monitoring.ScheduledQueryRulesAlert("scheduledQueryRulesAlertResource", new()
    {
        Action = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertActionArgs
        {
            ActionGroups = new[]
            {
                "string",
            },
            CustomWebhookPayload = "string",
            EmailSubject = "string",
        },
        Trigger = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertTriggerArgs
        {
            Operator = "string",
            Threshold = 0,
            MetricTrigger = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertTriggerMetricTriggerArgs
            {
                MetricTriggerType = "string",
                Operator = "string",
                Threshold = 0,
                MetricColumn = "string",
            },
        },
        TimeWindow = 0,
        DataSourceId = "string",
        ResourceGroupName = "string",
        Query = "string",
        Frequency = 0,
        Name = "string",
        Location = "string",
        Enabled = false,
        QueryType = "string",
        Description = "string",
        Severity = 0,
        Tags = 
        {
            { "string", "string" },
        },
        Throttling = 0,
        AutoMitigationEnabled = false,
        AuthorizedResourceIds = new[]
        {
            "string",
        },
    });
    
    example, err := monitoring.NewScheduledQueryRulesAlert(ctx, "scheduledQueryRulesAlertResource", &monitoring.ScheduledQueryRulesAlertArgs{
    	Action: &monitoring.ScheduledQueryRulesAlertActionArgs{
    		ActionGroups: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		CustomWebhookPayload: pulumi.String("string"),
    		EmailSubject:         pulumi.String("string"),
    	},
    	Trigger: &monitoring.ScheduledQueryRulesAlertTriggerArgs{
    		Operator:  pulumi.String("string"),
    		Threshold: pulumi.Float64(0),
    		MetricTrigger: &monitoring.ScheduledQueryRulesAlertTriggerMetricTriggerArgs{
    			MetricTriggerType: pulumi.String("string"),
    			Operator:          pulumi.String("string"),
    			Threshold:         pulumi.Float64(0),
    			MetricColumn:      pulumi.String("string"),
    		},
    	},
    	TimeWindow:        pulumi.Int(0),
    	DataSourceId:      pulumi.String("string"),
    	ResourceGroupName: pulumi.String("string"),
    	Query:             pulumi.String("string"),
    	Frequency:         pulumi.Int(0),
    	Name:              pulumi.String("string"),
    	Location:          pulumi.String("string"),
    	Enabled:           pulumi.Bool(false),
    	QueryType:         pulumi.String("string"),
    	Description:       pulumi.String("string"),
    	Severity:          pulumi.Int(0),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Throttling:            pulumi.Int(0),
    	AutoMitigationEnabled: pulumi.Bool(false),
    	AuthorizedResourceIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var scheduledQueryRulesAlertResource = new ScheduledQueryRulesAlert("scheduledQueryRulesAlertResource", ScheduledQueryRulesAlertArgs.builder()
        .action(ScheduledQueryRulesAlertActionArgs.builder()
            .actionGroups("string")
            .customWebhookPayload("string")
            .emailSubject("string")
            .build())
        .trigger(ScheduledQueryRulesAlertTriggerArgs.builder()
            .operator("string")
            .threshold(0.0)
            .metricTrigger(ScheduledQueryRulesAlertTriggerMetricTriggerArgs.builder()
                .metricTriggerType("string")
                .operator("string")
                .threshold(0.0)
                .metricColumn("string")
                .build())
            .build())
        .timeWindow(0)
        .dataSourceId("string")
        .resourceGroupName("string")
        .query("string")
        .frequency(0)
        .name("string")
        .location("string")
        .enabled(false)
        .queryType("string")
        .description("string")
        .severity(0)
        .tags(Map.of("string", "string"))
        .throttling(0)
        .autoMitigationEnabled(false)
        .authorizedResourceIds("string")
        .build());
    
    scheduled_query_rules_alert_resource = azure.monitoring.ScheduledQueryRulesAlert("scheduledQueryRulesAlertResource",
        action={
            "action_groups": ["string"],
            "custom_webhook_payload": "string",
            "email_subject": "string",
        },
        trigger={
            "operator": "string",
            "threshold": 0,
            "metric_trigger": {
                "metric_trigger_type": "string",
                "operator": "string",
                "threshold": 0,
                "metric_column": "string",
            },
        },
        time_window=0,
        data_source_id="string",
        resource_group_name="string",
        query="string",
        frequency=0,
        name="string",
        location="string",
        enabled=False,
        query_type="string",
        description="string",
        severity=0,
        tags={
            "string": "string",
        },
        throttling=0,
        auto_mitigation_enabled=False,
        authorized_resource_ids=["string"])
    
    const scheduledQueryRulesAlertResource = new azure.monitoring.ScheduledQueryRulesAlert("scheduledQueryRulesAlertResource", {
        action: {
            actionGroups: ["string"],
            customWebhookPayload: "string",
            emailSubject: "string",
        },
        trigger: {
            operator: "string",
            threshold: 0,
            metricTrigger: {
                metricTriggerType: "string",
                operator: "string",
                threshold: 0,
                metricColumn: "string",
            },
        },
        timeWindow: 0,
        dataSourceId: "string",
        resourceGroupName: "string",
        query: "string",
        frequency: 0,
        name: "string",
        location: "string",
        enabled: false,
        queryType: "string",
        description: "string",
        severity: 0,
        tags: {
            string: "string",
        },
        throttling: 0,
        autoMitigationEnabled: false,
        authorizedResourceIds: ["string"],
    });
    
    type: azure:monitoring:ScheduledQueryRulesAlert
    properties:
        action:
            actionGroups:
                - string
            customWebhookPayload: string
            emailSubject: string
        authorizedResourceIds:
            - string
        autoMitigationEnabled: false
        dataSourceId: string
        description: string
        enabled: false
        frequency: 0
        location: string
        name: string
        query: string
        queryType: string
        resourceGroupName: string
        severity: 0
        tags:
            string: string
        throttling: 0
        timeWindow: 0
        trigger:
            metricTrigger:
                metricColumn: string
                metricTriggerType: string
                operator: string
                threshold: 0
            operator: string
            threshold: 0
    

    ScheduledQueryRulesAlert Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ScheduledQueryRulesAlert resource accepts the following input properties:

    Action ScheduledQueryRulesAlertAction
    An action block as defined below.
    DataSourceId string
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    Frequency int
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    Query string
    Log search query.
    ResourceGroupName string
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    TimeWindow int
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    Trigger ScheduledQueryRulesAlertTrigger
    A trigger block as defined below.
    AuthorizedResourceIds List<string>
    List of Resource IDs referred into query.
    AutoMitigationEnabled bool

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    Description string
    The description of the scheduled query rule.
    Enabled bool
    Whether this scheduled query rule is enabled. Default is true.
    Location string
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    Name string
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    QueryType string
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    Severity int
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    Throttling int
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    Action ScheduledQueryRulesAlertActionArgs
    An action block as defined below.
    DataSourceId string
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    Frequency int
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    Query string
    Log search query.
    ResourceGroupName string
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    TimeWindow int
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    Trigger ScheduledQueryRulesAlertTriggerArgs
    A trigger block as defined below.
    AuthorizedResourceIds []string
    List of Resource IDs referred into query.
    AutoMitigationEnabled bool

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    Description string
    The description of the scheduled query rule.
    Enabled bool
    Whether this scheduled query rule is enabled. Default is true.
    Location string
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    Name string
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    QueryType string
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    Severity int
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    Throttling int
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    action ScheduledQueryRulesAlertAction
    An action block as defined below.
    dataSourceId String
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    frequency Integer
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    query String
    Log search query.
    resourceGroupName String
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    timeWindow Integer
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    trigger ScheduledQueryRulesAlertTrigger
    A trigger block as defined below.
    authorizedResourceIds List<String>
    List of Resource IDs referred into query.
    autoMitigationEnabled Boolean

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    description String
    The description of the scheduled query rule.
    enabled Boolean
    Whether this scheduled query rule is enabled. Default is true.
    location String
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    name String
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    queryType String
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    severity Integer
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    throttling Integer
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    action ScheduledQueryRulesAlertAction
    An action block as defined below.
    dataSourceId string
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    frequency number
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    query string
    Log search query.
    resourceGroupName string
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    timeWindow number
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    trigger ScheduledQueryRulesAlertTrigger
    A trigger block as defined below.
    authorizedResourceIds string[]
    List of Resource IDs referred into query.
    autoMitigationEnabled boolean

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    description string
    The description of the scheduled query rule.
    enabled boolean
    Whether this scheduled query rule is enabled. Default is true.
    location string
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    name string
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    queryType string
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    severity number
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    throttling number
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    action ScheduledQueryRulesAlertActionArgs
    An action block as defined below.
    data_source_id str
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    frequency int
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    query str
    Log search query.
    resource_group_name str
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    time_window int
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    trigger ScheduledQueryRulesAlertTriggerArgs
    A trigger block as defined below.
    authorized_resource_ids Sequence[str]
    List of Resource IDs referred into query.
    auto_mitigation_enabled bool

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    description str
    The description of the scheduled query rule.
    enabled bool
    Whether this scheduled query rule is enabled. Default is true.
    location str
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    name str
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    query_type str
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    severity int
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    throttling int
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    action Property Map
    An action block as defined below.
    dataSourceId String
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    frequency Number
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    query String
    Log search query.
    resourceGroupName String
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    timeWindow Number
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    trigger Property Map
    A trigger block as defined below.
    authorizedResourceIds List<String>
    List of Resource IDs referred into query.
    autoMitigationEnabled Boolean

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    description String
    The description of the scheduled query rule.
    enabled Boolean
    Whether this scheduled query rule is enabled. Default is true.
    location String
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    name String
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    queryType String
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    severity Number
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    tags Map<String>
    A mapping of tags to assign to the resource.
    throttling Number
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ScheduledQueryRulesAlert resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ScheduledQueryRulesAlert Resource

    Get an existing ScheduledQueryRulesAlert resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ScheduledQueryRulesAlertState, opts?: CustomResourceOptions): ScheduledQueryRulesAlert
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            action: Optional[ScheduledQueryRulesAlertActionArgs] = None,
            authorized_resource_ids: Optional[Sequence[str]] = None,
            auto_mitigation_enabled: Optional[bool] = None,
            data_source_id: Optional[str] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            frequency: Optional[int] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            query: Optional[str] = None,
            query_type: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            severity: Optional[int] = None,
            tags: Optional[Mapping[str, str]] = None,
            throttling: Optional[int] = None,
            time_window: Optional[int] = None,
            trigger: Optional[ScheduledQueryRulesAlertTriggerArgs] = None) -> ScheduledQueryRulesAlert
    func GetScheduledQueryRulesAlert(ctx *Context, name string, id IDInput, state *ScheduledQueryRulesAlertState, opts ...ResourceOption) (*ScheduledQueryRulesAlert, error)
    public static ScheduledQueryRulesAlert Get(string name, Input<string> id, ScheduledQueryRulesAlertState? state, CustomResourceOptions? opts = null)
    public static ScheduledQueryRulesAlert get(String name, Output<String> id, ScheduledQueryRulesAlertState state, CustomResourceOptions options)
    resources:  _:    type: azure:monitoring:ScheduledQueryRulesAlert    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Action ScheduledQueryRulesAlertAction
    An action block as defined below.
    AuthorizedResourceIds List<string>
    List of Resource IDs referred into query.
    AutoMitigationEnabled bool

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    DataSourceId string
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    Description string
    The description of the scheduled query rule.
    Enabled bool
    Whether this scheduled query rule is enabled. Default is true.
    Frequency int
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    Location string
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    Name string
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    Query string
    Log search query.
    QueryType string
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    ResourceGroupName string
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    Severity int
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    Throttling int
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    TimeWindow int
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    Trigger ScheduledQueryRulesAlertTrigger
    A trigger block as defined below.
    Action ScheduledQueryRulesAlertActionArgs
    An action block as defined below.
    AuthorizedResourceIds []string
    List of Resource IDs referred into query.
    AutoMitigationEnabled bool

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    DataSourceId string
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    Description string
    The description of the scheduled query rule.
    Enabled bool
    Whether this scheduled query rule is enabled. Default is true.
    Frequency int
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    Location string
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    Name string
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    Query string
    Log search query.
    QueryType string
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    ResourceGroupName string
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    Severity int
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    Throttling int
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    TimeWindow int
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    Trigger ScheduledQueryRulesAlertTriggerArgs
    A trigger block as defined below.
    action ScheduledQueryRulesAlertAction
    An action block as defined below.
    authorizedResourceIds List<String>
    List of Resource IDs referred into query.
    autoMitigationEnabled Boolean

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    dataSourceId String
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    description String
    The description of the scheduled query rule.
    enabled Boolean
    Whether this scheduled query rule is enabled. Default is true.
    frequency Integer
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    location String
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    name String
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    query String
    Log search query.
    queryType String
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    resourceGroupName String
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    severity Integer
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    throttling Integer
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    timeWindow Integer
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    trigger ScheduledQueryRulesAlertTrigger
    A trigger block as defined below.
    action ScheduledQueryRulesAlertAction
    An action block as defined below.
    authorizedResourceIds string[]
    List of Resource IDs referred into query.
    autoMitigationEnabled boolean

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    dataSourceId string
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    description string
    The description of the scheduled query rule.
    enabled boolean
    Whether this scheduled query rule is enabled. Default is true.
    frequency number
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    location string
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    name string
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    query string
    Log search query.
    queryType string
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    resourceGroupName string
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    severity number
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    throttling number
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    timeWindow number
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    trigger ScheduledQueryRulesAlertTrigger
    A trigger block as defined below.
    action ScheduledQueryRulesAlertActionArgs
    An action block as defined below.
    authorized_resource_ids Sequence[str]
    List of Resource IDs referred into query.
    auto_mitigation_enabled bool

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    data_source_id str
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    description str
    The description of the scheduled query rule.
    enabled bool
    Whether this scheduled query rule is enabled. Default is true.
    frequency int
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    location str
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    name str
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    query str
    Log search query.
    query_type str
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    resource_group_name str
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    severity int
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    throttling int
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    time_window int
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    trigger ScheduledQueryRulesAlertTriggerArgs
    A trigger block as defined below.
    action Property Map
    An action block as defined below.
    authorizedResourceIds List<String>
    List of Resource IDs referred into query.
    autoMitigationEnabled Boolean

    Should the alerts in this Metric Alert be auto resolved? Defaults to false.

    Note: auto_mitigation_enabled and throttling are mutually exclusive and cannot both be set.

    dataSourceId String
    The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
    description String
    The description of the scheduled query rule.
    enabled Boolean
    Whether this scheduled query rule is enabled. Default is true.
    frequency Number
    Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
    location String
    Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
    name String
    The name of the scheduled query rule. Changing this forces a new resource to be created.
    query String
    Log search query.
    queryType String
    The type of query results. Possible values are ResultCount and Number. Default is ResultCount. If set to ResultCount, query must include an AggregatedValue column of a numeric type, for example, Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m).
    resourceGroupName String
    The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
    severity Number
    Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
    tags Map<String>
    A mapping of tags to assign to the resource.
    throttling Number
    Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
    timeWindow Number
    Time window for which data needs to be fetched for query (must be greater than or equal to frequency). Values must be between 5 and 2880 (inclusive).
    trigger Property Map
    A trigger block as defined below.

    Supporting Types

    ScheduledQueryRulesAlertAction, ScheduledQueryRulesAlertActionArgs

    ActionGroups List<string>
    List of action group reference resource IDs.
    CustomWebhookPayload string
    Custom payload to be sent for all webhook payloads in alerting action.
    EmailSubject string
    Custom subject override for all email ids in Azure action group.
    ActionGroups []string
    List of action group reference resource IDs.
    CustomWebhookPayload string
    Custom payload to be sent for all webhook payloads in alerting action.
    EmailSubject string
    Custom subject override for all email ids in Azure action group.
    actionGroups List<String>
    List of action group reference resource IDs.
    customWebhookPayload String
    Custom payload to be sent for all webhook payloads in alerting action.
    emailSubject String
    Custom subject override for all email ids in Azure action group.
    actionGroups string[]
    List of action group reference resource IDs.
    customWebhookPayload string
    Custom payload to be sent for all webhook payloads in alerting action.
    emailSubject string
    Custom subject override for all email ids in Azure action group.
    action_groups Sequence[str]
    List of action group reference resource IDs.
    custom_webhook_payload str
    Custom payload to be sent for all webhook payloads in alerting action.
    email_subject str
    Custom subject override for all email ids in Azure action group.
    actionGroups List<String>
    List of action group reference resource IDs.
    customWebhookPayload String
    Custom payload to be sent for all webhook payloads in alerting action.
    emailSubject String
    Custom subject override for all email ids in Azure action group.

    ScheduledQueryRulesAlertTrigger, ScheduledQueryRulesAlertTriggerArgs

    Operator string
    Evaluation operation for rule - 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    Threshold double
    Result or count threshold based on which rule should be triggered. Values must be between 0 and 10000 inclusive.
    MetricTrigger ScheduledQueryRulesAlertTriggerMetricTrigger
    A metric_trigger block as defined above. Trigger condition for metric query rule.
    Operator string
    Evaluation operation for rule - 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    Threshold float64
    Result or count threshold based on which rule should be triggered. Values must be between 0 and 10000 inclusive.
    MetricTrigger ScheduledQueryRulesAlertTriggerMetricTrigger
    A metric_trigger block as defined above. Trigger condition for metric query rule.
    operator String
    Evaluation operation for rule - 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    threshold Double
    Result or count threshold based on which rule should be triggered. Values must be between 0 and 10000 inclusive.
    metricTrigger ScheduledQueryRulesAlertTriggerMetricTrigger
    A metric_trigger block as defined above. Trigger condition for metric query rule.
    operator string
    Evaluation operation for rule - 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    threshold number
    Result or count threshold based on which rule should be triggered. Values must be between 0 and 10000 inclusive.
    metricTrigger ScheduledQueryRulesAlertTriggerMetricTrigger
    A metric_trigger block as defined above. Trigger condition for metric query rule.
    operator str
    Evaluation operation for rule - 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    threshold float
    Result or count threshold based on which rule should be triggered. Values must be between 0 and 10000 inclusive.
    metric_trigger ScheduledQueryRulesAlertTriggerMetricTrigger
    A metric_trigger block as defined above. Trigger condition for metric query rule.
    operator String
    Evaluation operation for rule - 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    threshold Number
    Result or count threshold based on which rule should be triggered. Values must be between 0 and 10000 inclusive.
    metricTrigger Property Map
    A metric_trigger block as defined above. Trigger condition for metric query rule.

    ScheduledQueryRulesAlertTriggerMetricTrigger, ScheduledQueryRulesAlertTriggerMetricTriggerArgs

    MetricTriggerType string
    Metric Trigger Type - 'Consecutive' or 'Total'.
    Operator string
    Evaluation operation for rule - 'Equal', 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    Threshold double
    The threshold of the metric trigger. Values must be between 0 and 10000 inclusive.
    MetricColumn string
    Evaluation of metric on a particular column.
    MetricTriggerType string
    Metric Trigger Type - 'Consecutive' or 'Total'.
    Operator string
    Evaluation operation for rule - 'Equal', 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    Threshold float64
    The threshold of the metric trigger. Values must be between 0 and 10000 inclusive.
    MetricColumn string
    Evaluation of metric on a particular column.
    metricTriggerType String
    Metric Trigger Type - 'Consecutive' or 'Total'.
    operator String
    Evaluation operation for rule - 'Equal', 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    threshold Double
    The threshold of the metric trigger. Values must be between 0 and 10000 inclusive.
    metricColumn String
    Evaluation of metric on a particular column.
    metricTriggerType string
    Metric Trigger Type - 'Consecutive' or 'Total'.
    operator string
    Evaluation operation for rule - 'Equal', 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    threshold number
    The threshold of the metric trigger. Values must be between 0 and 10000 inclusive.
    metricColumn string
    Evaluation of metric on a particular column.
    metric_trigger_type str
    Metric Trigger Type - 'Consecutive' or 'Total'.
    operator str
    Evaluation operation for rule - 'Equal', 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    threshold float
    The threshold of the metric trigger. Values must be between 0 and 10000 inclusive.
    metric_column str
    Evaluation of metric on a particular column.
    metricTriggerType String
    Metric Trigger Type - 'Consecutive' or 'Total'.
    operator String
    Evaluation operation for rule - 'Equal', 'GreaterThan', GreaterThanOrEqual', 'LessThan', or 'LessThanOrEqual'.
    threshold Number
    The threshold of the metric trigger. Values must be between 0 and 10000 inclusive.
    metricColumn String
    Evaluation of metric on a particular column.

    Import

    Scheduled Query Rule Alerts can be imported using the resource id, e.g.

    $ pulumi import azure:monitoring/scheduledQueryRulesAlert:ScheduledQueryRulesAlert example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/scheduledQueryRules/myrulename
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure v6.30.0 published on Thursday, Nov 20, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate