1. Packages
  2. Azure Classic
  3. API Docs
  4. appinsights
  5. SmartDetectionRule

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

azure.appinsights.SmartDetectionRule

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi

    Manages an Application Insights Smart Detection Rule.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "tf-test",
        location: "West Europe",
    });
    const exampleInsights = new azure.appinsights.Insights("example", {
        name: "tf-test-appinsights",
        location: example.location,
        resourceGroupName: example.name,
        applicationType: "web",
    });
    const exampleSmartDetectionRule = new azure.appinsights.SmartDetectionRule("example", {
        name: "Slow server response time",
        applicationInsightsId: exampleInsights.id,
        enabled: false,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="tf-test",
        location="West Europe")
    example_insights = azure.appinsights.Insights("example",
        name="tf-test-appinsights",
        location=example.location,
        resource_group_name=example.name,
        application_type="web")
    example_smart_detection_rule = azure.appinsights.SmartDetectionRule("example",
        name="Slow server response time",
        application_insights_id=example_insights.id,
        enabled=False)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"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("tf-test"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleInsights, err := appinsights.NewInsights(ctx, "example", &appinsights.InsightsArgs{
    			Name:              pulumi.String("tf-test-appinsights"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			ApplicationType:   pulumi.String("web"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = appinsights.NewSmartDetectionRule(ctx, "example", &appinsights.SmartDetectionRuleArgs{
    			Name:                  pulumi.String("Slow server response time"),
    			ApplicationInsightsId: exampleInsights.ID(),
    			Enabled:               pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "tf-test",
            Location = "West Europe",
        });
    
        var exampleInsights = new Azure.AppInsights.Insights("example", new()
        {
            Name = "tf-test-appinsights",
            Location = example.Location,
            ResourceGroupName = example.Name,
            ApplicationType = "web",
        });
    
        var exampleSmartDetectionRule = new Azure.AppInsights.SmartDetectionRule("example", new()
        {
            Name = "Slow server response time",
            ApplicationInsightsId = exampleInsights.Id,
            Enabled = false,
        });
    
    });
    
    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.appinsights.SmartDetectionRule;
    import com.pulumi.azure.appinsights.SmartDetectionRuleArgs;
    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("tf-test")
                .location("West Europe")
                .build());
    
            var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
                .name("tf-test-appinsights")
                .location(example.location())
                .resourceGroupName(example.name())
                .applicationType("web")
                .build());
    
            var exampleSmartDetectionRule = new SmartDetectionRule("exampleSmartDetectionRule", SmartDetectionRuleArgs.builder()
                .name("Slow server response time")
                .applicationInsightsId(exampleInsights.id())
                .enabled(false)
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: tf-test
          location: West Europe
      exampleInsights:
        type: azure:appinsights:Insights
        name: example
        properties:
          name: tf-test-appinsights
          location: ${example.location}
          resourceGroupName: ${example.name}
          applicationType: web
      exampleSmartDetectionRule:
        type: azure:appinsights:SmartDetectionRule
        name: example
        properties:
          name: Slow server response time
          applicationInsightsId: ${exampleInsights.id}
          enabled: false
    

    Create SmartDetectionRule Resource

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

    Constructor syntax

    new SmartDetectionRule(name: string, args: SmartDetectionRuleArgs, opts?: CustomResourceOptions);
    @overload
    def SmartDetectionRule(resource_name: str,
                           args: SmartDetectionRuleArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def SmartDetectionRule(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           application_insights_id: Optional[str] = None,
                           additional_email_recipients: Optional[Sequence[str]] = None,
                           enabled: Optional[bool] = None,
                           name: Optional[str] = None,
                           send_emails_to_subscription_owners: Optional[bool] = None)
    func NewSmartDetectionRule(ctx *Context, name string, args SmartDetectionRuleArgs, opts ...ResourceOption) (*SmartDetectionRule, error)
    public SmartDetectionRule(string name, SmartDetectionRuleArgs args, CustomResourceOptions? opts = null)
    public SmartDetectionRule(String name, SmartDetectionRuleArgs args)
    public SmartDetectionRule(String name, SmartDetectionRuleArgs args, CustomResourceOptions options)
    
    type: azure:appinsights:SmartDetectionRule
    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 SmartDetectionRuleArgs
    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 SmartDetectionRuleArgs
    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 SmartDetectionRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SmartDetectionRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SmartDetectionRuleArgs
    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 smartDetectionRuleResource = new Azure.AppInsights.SmartDetectionRule("smartDetectionRuleResource", new()
    {
        ApplicationInsightsId = "string",
        AdditionalEmailRecipients = new[]
        {
            "string",
        },
        Enabled = false,
        Name = "string",
        SendEmailsToSubscriptionOwners = false,
    });
    
    example, err := appinsights.NewSmartDetectionRule(ctx, "smartDetectionRuleResource", &appinsights.SmartDetectionRuleArgs{
    	ApplicationInsightsId: pulumi.String("string"),
    	AdditionalEmailRecipients: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Enabled:                        pulumi.Bool(false),
    	Name:                           pulumi.String("string"),
    	SendEmailsToSubscriptionOwners: pulumi.Bool(false),
    })
    
    var smartDetectionRuleResource = new SmartDetectionRule("smartDetectionRuleResource", SmartDetectionRuleArgs.builder()
        .applicationInsightsId("string")
        .additionalEmailRecipients("string")
        .enabled(false)
        .name("string")
        .sendEmailsToSubscriptionOwners(false)
        .build());
    
    smart_detection_rule_resource = azure.appinsights.SmartDetectionRule("smartDetectionRuleResource",
        application_insights_id="string",
        additional_email_recipients=["string"],
        enabled=False,
        name="string",
        send_emails_to_subscription_owners=False)
    
    const smartDetectionRuleResource = new azure.appinsights.SmartDetectionRule("smartDetectionRuleResource", {
        applicationInsightsId: "string",
        additionalEmailRecipients: ["string"],
        enabled: false,
        name: "string",
        sendEmailsToSubscriptionOwners: false,
    });
    
    type: azure:appinsights:SmartDetectionRule
    properties:
        additionalEmailRecipients:
            - string
        applicationInsightsId: string
        enabled: false
        name: string
        sendEmailsToSubscriptionOwners: false
    

    SmartDetectionRule 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 SmartDetectionRule resource accepts the following input properties:

    ApplicationInsightsId string
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    AdditionalEmailRecipients List<string>

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    Enabled bool
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    Name string
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    SendEmailsToSubscriptionOwners bool
    Do emails get sent to subscription owners? Defaults to true.
    ApplicationInsightsId string
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    AdditionalEmailRecipients []string

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    Enabled bool
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    Name string
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    SendEmailsToSubscriptionOwners bool
    Do emails get sent to subscription owners? Defaults to true.
    applicationInsightsId String
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    additionalEmailRecipients List<String>

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    enabled Boolean
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    name String
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    sendEmailsToSubscriptionOwners Boolean
    Do emails get sent to subscription owners? Defaults to true.
    applicationInsightsId string
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    additionalEmailRecipients string[]

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    enabled boolean
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    name string
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    sendEmailsToSubscriptionOwners boolean
    Do emails get sent to subscription owners? Defaults to true.
    application_insights_id str
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    additional_email_recipients Sequence[str]

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    enabled bool
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    name str
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    send_emails_to_subscription_owners bool
    Do emails get sent to subscription owners? Defaults to true.
    applicationInsightsId String
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    additionalEmailRecipients List<String>

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    enabled Boolean
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    name String
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    sendEmailsToSubscriptionOwners Boolean
    Do emails get sent to subscription owners? Defaults to true.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SmartDetectionRule 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 SmartDetectionRule Resource

    Get an existing SmartDetectionRule 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?: SmartDetectionRuleState, opts?: CustomResourceOptions): SmartDetectionRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            additional_email_recipients: Optional[Sequence[str]] = None,
            application_insights_id: Optional[str] = None,
            enabled: Optional[bool] = None,
            name: Optional[str] = None,
            send_emails_to_subscription_owners: Optional[bool] = None) -> SmartDetectionRule
    func GetSmartDetectionRule(ctx *Context, name string, id IDInput, state *SmartDetectionRuleState, opts ...ResourceOption) (*SmartDetectionRule, error)
    public static SmartDetectionRule Get(string name, Input<string> id, SmartDetectionRuleState? state, CustomResourceOptions? opts = null)
    public static SmartDetectionRule get(String name, Output<String> id, SmartDetectionRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    AdditionalEmailRecipients List<string>

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    ApplicationInsightsId string
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    Enabled bool
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    Name string
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    SendEmailsToSubscriptionOwners bool
    Do emails get sent to subscription owners? Defaults to true.
    AdditionalEmailRecipients []string

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    ApplicationInsightsId string
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    Enabled bool
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    Name string
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    SendEmailsToSubscriptionOwners bool
    Do emails get sent to subscription owners? Defaults to true.
    additionalEmailRecipients List<String>

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    applicationInsightsId String
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    enabled Boolean
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    name String
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    sendEmailsToSubscriptionOwners Boolean
    Do emails get sent to subscription owners? Defaults to true.
    additionalEmailRecipients string[]

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    applicationInsightsId string
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    enabled boolean
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    name string
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    sendEmailsToSubscriptionOwners boolean
    Do emails get sent to subscription owners? Defaults to true.
    additional_email_recipients Sequence[str]

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    application_insights_id str
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    enabled bool
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    name str
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    send_emails_to_subscription_owners bool
    Do emails get sent to subscription owners? Defaults to true.
    additionalEmailRecipients List<String>

    Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.

    Note: At least one read or write permission must be defined.

    applicationInsightsId String
    The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
    enabled Boolean
    Is the Application Insights Smart Detection Rule enabled? Defaults to true.
    name String
    Specifies the name of the Application Insights Smart Detection Rule. Valid values include Slow page load time, Slow server response time, Potential memory leak detected, Potential security issue detected, Long dependency duration, Degradation in server response time, Degradation in dependency duration, Degradation in trace severity ratio, Abnormal rise in exception volume, Abnormal rise in daily data volume. Changing this forces a new resource to be created.
    sendEmailsToSubscriptionOwners Boolean
    Do emails get sent to subscription owners? Defaults to true.

    Import

    Application Insights Smart Detection Rules can be imported using the resource id, e.g.

    $ pulumi import azure:appinsights/smartDetectionRule:SmartDetectionRule rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/components/mycomponent1/proactiveDetectionConfigs/myrule1
    

    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 Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi