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

We recommend using Azure Native.

Azure Classic v5.71.0 published on Tuesday, Apr 9, 2024 by Pulumi

azure.monitoring.AadDiagnosticSetting

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.71.0 published on Tuesday, Apr 9, 2024 by Pulumi

    Manages an Azure Active Directory Diagnostic Setting for Azure Monitor.

    !> Authentication The API for this resource does not support service principal authentication. This resource can only be used with Azure CLI authentication.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-rg",
        location: "west europe",
    });
    const exampleAccount = new azure.storage.Account("example", {
        name: "examplestorageaccount",
        resourceGroupName: example.name,
        location: example.location,
        accountTier: "Standard",
        accountKind: "StorageV2",
        accountReplicationType: "LRS",
    });
    const exampleAadDiagnosticSetting = new azure.monitoring.AadDiagnosticSetting("example", {
        name: "setting1",
        storageAccountId: exampleAccount.id,
        enabledLogs: [
            {
                category: "SignInLogs",
                retentionPolicy: {
                    enabled: true,
                    days: 1,
                },
            },
            {
                category: "AuditLogs",
                retentionPolicy: {
                    enabled: true,
                    days: 1,
                },
            },
            {
                category: "NonInteractiveUserSignInLogs",
                retentionPolicy: {
                    enabled: true,
                    days: 1,
                },
            },
            {
                category: "ServicePrincipalSignInLogs",
                retentionPolicy: {
                    enabled: true,
                    days: 1,
                },
            },
        ],
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-rg",
        location="west europe")
    example_account = azure.storage.Account("example",
        name="examplestorageaccount",
        resource_group_name=example.name,
        location=example.location,
        account_tier="Standard",
        account_kind="StorageV2",
        account_replication_type="LRS")
    example_aad_diagnostic_setting = azure.monitoring.AadDiagnosticSetting("example",
        name="setting1",
        storage_account_id=example_account.id,
        enabled_logs=[
            azure.monitoring.AadDiagnosticSettingEnabledLogArgs(
                category="SignInLogs",
                retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs(
                    enabled=True,
                    days=1,
                ),
            ),
            azure.monitoring.AadDiagnosticSettingEnabledLogArgs(
                category="AuditLogs",
                retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs(
                    enabled=True,
                    days=1,
                ),
            ),
            azure.monitoring.AadDiagnosticSettingEnabledLogArgs(
                category="NonInteractiveUserSignInLogs",
                retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs(
                    enabled=True,
                    days=1,
                ),
            ),
            azure.monitoring.AadDiagnosticSettingEnabledLogArgs(
                category="ServicePrincipalSignInLogs",
                retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs(
                    enabled=True,
                    days=1,
                ),
            ),
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-rg"),
    			Location: pulumi.String("west europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
    			Name:                   pulumi.String("examplestorageaccount"),
    			ResourceGroupName:      example.Name,
    			Location:               example.Location,
    			AccountTier:            pulumi.String("Standard"),
    			AccountKind:            pulumi.String("StorageV2"),
    			AccountReplicationType: pulumi.String("LRS"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = monitoring.NewAadDiagnosticSetting(ctx, "example", &monitoring.AadDiagnosticSettingArgs{
    			Name:             pulumi.String("setting1"),
    			StorageAccountId: exampleAccount.ID(),
    			EnabledLogs: monitoring.AadDiagnosticSettingEnabledLogArray{
    				&monitoring.AadDiagnosticSettingEnabledLogArgs{
    					Category: pulumi.String("SignInLogs"),
    					RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{
    						Enabled: pulumi.Bool(true),
    						Days:    pulumi.Int(1),
    					},
    				},
    				&monitoring.AadDiagnosticSettingEnabledLogArgs{
    					Category: pulumi.String("AuditLogs"),
    					RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{
    						Enabled: pulumi.Bool(true),
    						Days:    pulumi.Int(1),
    					},
    				},
    				&monitoring.AadDiagnosticSettingEnabledLogArgs{
    					Category: pulumi.String("NonInteractiveUserSignInLogs"),
    					RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{
    						Enabled: pulumi.Bool(true),
    						Days:    pulumi.Int(1),
    					},
    				},
    				&monitoring.AadDiagnosticSettingEnabledLogArgs{
    					Category: pulumi.String("ServicePrincipalSignInLogs"),
    					RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{
    						Enabled: pulumi.Bool(true),
    						Days:    pulumi.Int(1),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-rg",
            Location = "west europe",
        });
    
        var exampleAccount = new Azure.Storage.Account("example", new()
        {
            Name = "examplestorageaccount",
            ResourceGroupName = example.Name,
            Location = example.Location,
            AccountTier = "Standard",
            AccountKind = "StorageV2",
            AccountReplicationType = "LRS",
        });
    
        var exampleAadDiagnosticSetting = new Azure.Monitoring.AadDiagnosticSetting("example", new()
        {
            Name = "setting1",
            StorageAccountId = exampleAccount.Id,
            EnabledLogs = new[]
            {
                new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs
                {
                    Category = "SignInLogs",
                    RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs
                    {
                        Enabled = true,
                        Days = 1,
                    },
                },
                new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs
                {
                    Category = "AuditLogs",
                    RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs
                    {
                        Enabled = true,
                        Days = 1,
                    },
                },
                new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs
                {
                    Category = "NonInteractiveUserSignInLogs",
                    RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs
                    {
                        Enabled = true,
                        Days = 1,
                    },
                },
                new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs
                {
                    Category = "ServicePrincipalSignInLogs",
                    RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs
                    {
                        Enabled = true,
                        Days = 1,
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.storage.Account;
    import com.pulumi.azure.storage.AccountArgs;
    import com.pulumi.azure.monitoring.AadDiagnosticSetting;
    import com.pulumi.azure.monitoring.AadDiagnosticSettingArgs;
    import com.pulumi.azure.monitoring.inputs.AadDiagnosticSettingEnabledLogArgs;
    import com.pulumi.azure.monitoring.inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ResourceGroup("example", ResourceGroupArgs.builder()        
                .name("example-rg")
                .location("west europe")
                .build());
    
            var exampleAccount = new Account("exampleAccount", AccountArgs.builder()        
                .name("examplestorageaccount")
                .resourceGroupName(example.name())
                .location(example.location())
                .accountTier("Standard")
                .accountKind("StorageV2")
                .accountReplicationType("LRS")
                .build());
    
            var exampleAadDiagnosticSetting = new AadDiagnosticSetting("exampleAadDiagnosticSetting", AadDiagnosticSettingArgs.builder()        
                .name("setting1")
                .storageAccountId(exampleAccount.id())
                .enabledLogs(            
                    AadDiagnosticSettingEnabledLogArgs.builder()
                        .category("SignInLogs")
                        .retentionPolicy(AadDiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
                            .enabled(true)
                            .days(1)
                            .build())
                        .build(),
                    AadDiagnosticSettingEnabledLogArgs.builder()
                        .category("AuditLogs")
                        .retentionPolicy(AadDiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
                            .enabled(true)
                            .days(1)
                            .build())
                        .build(),
                    AadDiagnosticSettingEnabledLogArgs.builder()
                        .category("NonInteractiveUserSignInLogs")
                        .retentionPolicy(AadDiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
                            .enabled(true)
                            .days(1)
                            .build())
                        .build(),
                    AadDiagnosticSettingEnabledLogArgs.builder()
                        .category("ServicePrincipalSignInLogs")
                        .retentionPolicy(AadDiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
                            .enabled(true)
                            .days(1)
                            .build())
                        .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-rg
          location: west europe
      exampleAccount:
        type: azure:storage:Account
        name: example
        properties:
          name: examplestorageaccount
          resourceGroupName: ${example.name}
          location: ${example.location}
          accountTier: Standard
          accountKind: StorageV2
          accountReplicationType: LRS
      exampleAadDiagnosticSetting:
        type: azure:monitoring:AadDiagnosticSetting
        name: example
        properties:
          name: setting1
          storageAccountId: ${exampleAccount.id}
          enabledLogs:
            - category: SignInLogs
              retentionPolicy:
                enabled: true
                days: 1
            - category: AuditLogs
              retentionPolicy:
                enabled: true
                days: 1
            - category: NonInteractiveUserSignInLogs
              retentionPolicy:
                enabled: true
                days: 1
            - category: ServicePrincipalSignInLogs
              retentionPolicy:
                enabled: true
                days: 1
    

    Create AadDiagnosticSetting Resource

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

    Constructor syntax

    new AadDiagnosticSetting(name: string, args?: AadDiagnosticSettingArgs, opts?: CustomResourceOptions);
    @overload
    def AadDiagnosticSetting(resource_name: str,
                             args: Optional[AadDiagnosticSettingArgs] = None,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def AadDiagnosticSetting(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             enabled_logs: Optional[Sequence[AadDiagnosticSettingEnabledLogArgs]] = None,
                             eventhub_authorization_rule_id: Optional[str] = None,
                             eventhub_name: Optional[str] = None,
                             log_analytics_workspace_id: Optional[str] = None,
                             logs: Optional[Sequence[AadDiagnosticSettingLogArgs]] = None,
                             name: Optional[str] = None,
                             storage_account_id: Optional[str] = None)
    func NewAadDiagnosticSetting(ctx *Context, name string, args *AadDiagnosticSettingArgs, opts ...ResourceOption) (*AadDiagnosticSetting, error)
    public AadDiagnosticSetting(string name, AadDiagnosticSettingArgs? args = null, CustomResourceOptions? opts = null)
    public AadDiagnosticSetting(String name, AadDiagnosticSettingArgs args)
    public AadDiagnosticSetting(String name, AadDiagnosticSettingArgs args, CustomResourceOptions options)
    
    type: azure:monitoring:AadDiagnosticSetting
    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 AadDiagnosticSettingArgs
    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 AadDiagnosticSettingArgs
    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 AadDiagnosticSettingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AadDiagnosticSettingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AadDiagnosticSettingArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var aadDiagnosticSettingResource = new Azure.Monitoring.AadDiagnosticSetting("aadDiagnosticSettingResource", new()
    {
        EnabledLogs = new[]
        {
            new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs
            {
                Category = "string",
                RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs
                {
                    Days = 0,
                    Enabled = false,
                },
            },
        },
        EventhubAuthorizationRuleId = "string",
        EventhubName = "string",
        LogAnalyticsWorkspaceId = "string",
        Name = "string",
        StorageAccountId = "string",
    });
    
    example, err := monitoring.NewAadDiagnosticSetting(ctx, "aadDiagnosticSettingResource", &monitoring.AadDiagnosticSettingArgs{
    	EnabledLogs: monitoring.AadDiagnosticSettingEnabledLogArray{
    		&monitoring.AadDiagnosticSettingEnabledLogArgs{
    			Category: pulumi.String("string"),
    			RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{
    				Days:    pulumi.Int(0),
    				Enabled: pulumi.Bool(false),
    			},
    		},
    	},
    	EventhubAuthorizationRuleId: pulumi.String("string"),
    	EventhubName:                pulumi.String("string"),
    	LogAnalyticsWorkspaceId:     pulumi.String("string"),
    	Name:                        pulumi.String("string"),
    	StorageAccountId:            pulumi.String("string"),
    })
    
    var aadDiagnosticSettingResource = new AadDiagnosticSetting("aadDiagnosticSettingResource", AadDiagnosticSettingArgs.builder()        
        .enabledLogs(AadDiagnosticSettingEnabledLogArgs.builder()
            .category("string")
            .retentionPolicy(AadDiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
                .days(0)
                .enabled(false)
                .build())
            .build())
        .eventhubAuthorizationRuleId("string")
        .eventhubName("string")
        .logAnalyticsWorkspaceId("string")
        .name("string")
        .storageAccountId("string")
        .build());
    
    aad_diagnostic_setting_resource = azure.monitoring.AadDiagnosticSetting("aadDiagnosticSettingResource",
        enabled_logs=[azure.monitoring.AadDiagnosticSettingEnabledLogArgs(
            category="string",
            retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs(
                days=0,
                enabled=False,
            ),
        )],
        eventhub_authorization_rule_id="string",
        eventhub_name="string",
        log_analytics_workspace_id="string",
        name="string",
        storage_account_id="string")
    
    const aadDiagnosticSettingResource = new azure.monitoring.AadDiagnosticSetting("aadDiagnosticSettingResource", {
        enabledLogs: [{
            category: "string",
            retentionPolicy: {
                days: 0,
                enabled: false,
            },
        }],
        eventhubAuthorizationRuleId: "string",
        eventhubName: "string",
        logAnalyticsWorkspaceId: "string",
        name: "string",
        storageAccountId: "string",
    });
    
    type: azure:monitoring:AadDiagnosticSetting
    properties:
        enabledLogs:
            - category: string
              retentionPolicy:
                days: 0
                enabled: false
        eventhubAuthorizationRuleId: string
        eventhubName: string
        logAnalyticsWorkspaceId: string
        name: string
        storageAccountId: string
    

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

    EnabledLogs List<AadDiagnosticSettingEnabledLog>

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    EventhubAuthorizationRuleId string

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    EventhubName string
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    LogAnalyticsWorkspaceId string
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    Logs List<AadDiagnosticSettingLog>

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    Name string
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    StorageAccountId string

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    EnabledLogs []AadDiagnosticSettingEnabledLogArgs

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    EventhubAuthorizationRuleId string

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    EventhubName string
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    LogAnalyticsWorkspaceId string
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    Logs []AadDiagnosticSettingLogArgs

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    Name string
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    StorageAccountId string

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    enabledLogs List<AadDiagnosticSettingEnabledLog>

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    eventhubAuthorizationRuleId String

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    eventhubName String
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    logAnalyticsWorkspaceId String
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    logs List<AadDiagnosticSettingLog>

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    name String
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    storageAccountId String

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    enabledLogs AadDiagnosticSettingEnabledLog[]

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    eventhubAuthorizationRuleId string

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    eventhubName string
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    logAnalyticsWorkspaceId string
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    logs AadDiagnosticSettingLog[]

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    name string
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    storageAccountId string

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    enabled_logs Sequence[AadDiagnosticSettingEnabledLogArgs]

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    eventhub_authorization_rule_id str

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    eventhub_name str
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    log_analytics_workspace_id str
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    logs Sequence[AadDiagnosticSettingLogArgs]

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    name str
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    storage_account_id str

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    enabledLogs List<Property Map>

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    eventhubAuthorizationRuleId String

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    eventhubName String
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    logAnalyticsWorkspaceId String
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    logs List<Property Map>

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    name String
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    storageAccountId String

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    Outputs

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

    Get an existing AadDiagnosticSetting 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?: AadDiagnosticSettingState, opts?: CustomResourceOptions): AadDiagnosticSetting
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enabled_logs: Optional[Sequence[AadDiagnosticSettingEnabledLogArgs]] = None,
            eventhub_authorization_rule_id: Optional[str] = None,
            eventhub_name: Optional[str] = None,
            log_analytics_workspace_id: Optional[str] = None,
            logs: Optional[Sequence[AadDiagnosticSettingLogArgs]] = None,
            name: Optional[str] = None,
            storage_account_id: Optional[str] = None) -> AadDiagnosticSetting
    func GetAadDiagnosticSetting(ctx *Context, name string, id IDInput, state *AadDiagnosticSettingState, opts ...ResourceOption) (*AadDiagnosticSetting, error)
    public static AadDiagnosticSetting Get(string name, Input<string> id, AadDiagnosticSettingState? state, CustomResourceOptions? opts = null)
    public static AadDiagnosticSetting get(String name, Output<String> id, AadDiagnosticSettingState 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:
    EnabledLogs List<AadDiagnosticSettingEnabledLog>

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    EventhubAuthorizationRuleId string

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    EventhubName string
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    LogAnalyticsWorkspaceId string
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    Logs List<AadDiagnosticSettingLog>

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    Name string
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    StorageAccountId string

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    EnabledLogs []AadDiagnosticSettingEnabledLogArgs

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    EventhubAuthorizationRuleId string

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    EventhubName string
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    LogAnalyticsWorkspaceId string
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    Logs []AadDiagnosticSettingLogArgs

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    Name string
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    StorageAccountId string

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    enabledLogs List<AadDiagnosticSettingEnabledLog>

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    eventhubAuthorizationRuleId String

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    eventhubName String
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    logAnalyticsWorkspaceId String
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    logs List<AadDiagnosticSettingLog>

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    name String
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    storageAccountId String

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    enabledLogs AadDiagnosticSettingEnabledLog[]

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    eventhubAuthorizationRuleId string

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    eventhubName string
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    logAnalyticsWorkspaceId string
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    logs AadDiagnosticSettingLog[]

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    name string
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    storageAccountId string

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    enabled_logs Sequence[AadDiagnosticSettingEnabledLogArgs]

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    eventhub_authorization_rule_id str

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    eventhub_name str
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    log_analytics_workspace_id str
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    logs Sequence[AadDiagnosticSettingLogArgs]

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    name str
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    storage_account_id str

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    enabledLogs List<Property Map>

    One or more enabled_log blocks as defined below.

    NOTE: At least one log or enabled_log block must be specified. At least one type of Log must be enabled.

    eventhubAuthorizationRuleId String

    Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

    NOTE: This can be sourced from the azure.eventhub.EventHubNamespaceAuthorizationRule resource and is different from a azure.eventhub.AuthorizationRule resource.

    eventhubName String
    Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
    logAnalyticsWorkspaceId String
    Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
    logs List<Property Map>

    One or more log blocks as defined below.

    NOTE: log is deprecated in favour of the enabled_log property and will be removed in version 4.0 of the AzureRM Provider.

    Deprecated: log has been superseded by enabled_log and will be removed in version 4.0 of the AzureRM Provider.

    name String
    The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
    storageAccountId String

    The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.

    NOTE: One of eventhub_authorization_rule_id, log_analytics_workspace_id and storage_account_id must be specified.

    Supporting Types

    AadDiagnosticSettingEnabledLog, AadDiagnosticSettingEnabledLogArgs

    Category string
    The log category for the Azure Active Directory Diagnostic.
    RetentionPolicy AadDiagnosticSettingEnabledLogRetentionPolicy
    A retention_policy block as defined below.
    Category string
    The log category for the Azure Active Directory Diagnostic.
    RetentionPolicy AadDiagnosticSettingEnabledLogRetentionPolicy
    A retention_policy block as defined below.
    category String
    The log category for the Azure Active Directory Diagnostic.
    retentionPolicy AadDiagnosticSettingEnabledLogRetentionPolicy
    A retention_policy block as defined below.
    category string
    The log category for the Azure Active Directory Diagnostic.
    retentionPolicy AadDiagnosticSettingEnabledLogRetentionPolicy
    A retention_policy block as defined below.
    category str
    The log category for the Azure Active Directory Diagnostic.
    retention_policy AadDiagnosticSettingEnabledLogRetentionPolicy
    A retention_policy block as defined below.
    category String
    The log category for the Azure Active Directory Diagnostic.
    retentionPolicy Property Map
    A retention_policy block as defined below.

    AadDiagnosticSettingEnabledLogRetentionPolicy, AadDiagnosticSettingEnabledLogRetentionPolicyArgs

    Days int
    The number of days for which this Retention Policy should apply. Defaults to 0.
    Enabled bool
    Is this Retention Policy enabled? Defaults to false.
    Days int
    The number of days for which this Retention Policy should apply. Defaults to 0.
    Enabled bool
    Is this Retention Policy enabled? Defaults to false.
    days Integer
    The number of days for which this Retention Policy should apply. Defaults to 0.
    enabled Boolean
    Is this Retention Policy enabled? Defaults to false.
    days number
    The number of days for which this Retention Policy should apply. Defaults to 0.
    enabled boolean
    Is this Retention Policy enabled? Defaults to false.
    days int
    The number of days for which this Retention Policy should apply. Defaults to 0.
    enabled bool
    Is this Retention Policy enabled? Defaults to false.
    days Number
    The number of days for which this Retention Policy should apply. Defaults to 0.
    enabled Boolean
    Is this Retention Policy enabled? Defaults to false.

    AadDiagnosticSettingLog, AadDiagnosticSettingLogArgs

    Category string
    The log category for the Azure Active Directory Diagnostic.
    RetentionPolicy AadDiagnosticSettingLogRetentionPolicy
    A retention_policy block as defined below.
    Enabled bool
    Is this Diagnostic Log enabled? Defaults to true.
    Category string
    The log category for the Azure Active Directory Diagnostic.
    RetentionPolicy AadDiagnosticSettingLogRetentionPolicy
    A retention_policy block as defined below.
    Enabled bool
    Is this Diagnostic Log enabled? Defaults to true.
    category String
    The log category for the Azure Active Directory Diagnostic.
    retentionPolicy AadDiagnosticSettingLogRetentionPolicy
    A retention_policy block as defined below.
    enabled Boolean
    Is this Diagnostic Log enabled? Defaults to true.
    category string
    The log category for the Azure Active Directory Diagnostic.
    retentionPolicy AadDiagnosticSettingLogRetentionPolicy
    A retention_policy block as defined below.
    enabled boolean
    Is this Diagnostic Log enabled? Defaults to true.
    category str
    The log category for the Azure Active Directory Diagnostic.
    retention_policy AadDiagnosticSettingLogRetentionPolicy
    A retention_policy block as defined below.
    enabled bool
    Is this Diagnostic Log enabled? Defaults to true.
    category String
    The log category for the Azure Active Directory Diagnostic.
    retentionPolicy Property Map
    A retention_policy block as defined below.
    enabled Boolean
    Is this Diagnostic Log enabled? Defaults to true.

    AadDiagnosticSettingLogRetentionPolicy, AadDiagnosticSettingLogRetentionPolicyArgs

    Days int
    The number of days for which this Retention Policy should apply. Defaults to 0.
    Enabled bool
    Is this Retention Policy enabled? Defaults to false.
    Days int
    The number of days for which this Retention Policy should apply. Defaults to 0.
    Enabled bool
    Is this Retention Policy enabled? Defaults to false.
    days Integer
    The number of days for which this Retention Policy should apply. Defaults to 0.
    enabled Boolean
    Is this Retention Policy enabled? Defaults to false.
    days number
    The number of days for which this Retention Policy should apply. Defaults to 0.
    enabled boolean
    Is this Retention Policy enabled? Defaults to false.
    days int
    The number of days for which this Retention Policy should apply. Defaults to 0.
    enabled bool
    Is this Retention Policy enabled? Defaults to false.
    days Number
    The number of days for which this Retention Policy should apply. Defaults to 0.
    enabled Boolean
    Is this Retention Policy enabled? Defaults to false.

    Import

    Monitor Azure Active Directory Diagnostic Settings can be imported using the resource id, e.g.

    $ pulumi import azure:monitoring/aadDiagnosticSetting:AadDiagnosticSetting example /providers/Microsoft.AADIAM/diagnosticSettings/setting1
    

    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.71.0 published on Tuesday, Apr 9, 2024 by Pulumi