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

We recommend using Azure Native.

Azure Classic v5.49.0 published on Tuesday, Aug 29, 2023 by Pulumi

azure.monitoring.AadDiagnosticSetting

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.49.0 published on Tuesday, Aug 29, 2023 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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
        {
            Location = "west europe",
        });
    
        var exampleAccount = new Azure.Storage.Account("exampleAccount", new()
        {
            ResourceGroupName = exampleResourceGroup.Name,
            Location = exampleResourceGroup.Location,
            AccountTier = "Standard",
            AccountKind = "StorageV2",
            AccountReplicationType = "LRS",
        });
    
        var exampleAadDiagnosticSetting = new Azure.Monitoring.AadDiagnosticSetting("exampleAadDiagnosticSetting", new()
        {
            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 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 {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("west europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{
    			ResourceGroupName:      exampleResourceGroup.Name,
    			Location:               exampleResourceGroup.Location,
    			AccountTier:            pulumi.String("Standard"),
    			AccountKind:            pulumi.String("StorageV2"),
    			AccountReplicationType: pulumi.String("LRS"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = monitoring.NewAadDiagnosticSetting(ctx, "exampleAadDiagnosticSetting", &monitoring.AadDiagnosticSettingArgs{
    			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
    	})
    }
    
    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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
                .location("west europe")
                .build());
    
            var exampleAccount = new Account("exampleAccount", AccountArgs.builder()        
                .resourceGroupName(exampleResourceGroup.name())
                .location(exampleResourceGroup.location())
                .accountTier("Standard")
                .accountKind("StorageV2")
                .accountReplicationType("LRS")
                .build());
    
            var exampleAadDiagnosticSetting = new AadDiagnosticSetting("exampleAadDiagnosticSetting", AadDiagnosticSettingArgs.builder()        
                .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());
    
        }
    }
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe")
    example_account = azure.storage.Account("exampleAccount",
        resource_group_name=example_resource_group.name,
        location=example_resource_group.location,
        account_tier="Standard",
        account_kind="StorageV2",
        account_replication_type="LRS")
    example_aad_diagnostic_setting = azure.monitoring.AadDiagnosticSetting("exampleAadDiagnosticSetting",
        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,
                ),
            ),
        ])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"});
    const exampleAccount = new azure.storage.Account("exampleAccount", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
        accountTier: "Standard",
        accountKind: "StorageV2",
        accountReplicationType: "LRS",
    });
    const exampleAadDiagnosticSetting = new azure.monitoring.AadDiagnosticSetting("exampleAadDiagnosticSetting", {
        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,
                },
            },
        ],
    });
    
    resources:
      exampleResourceGroup:
        type: azure:core:ResourceGroup
        properties:
          location: west europe
      exampleAccount:
        type: azure:storage:Account
        properties:
          resourceGroupName: ${exampleResourceGroup.name}
          location: ${exampleResourceGroup.location}
          accountTier: Standard
          accountKind: StorageV2
          accountReplicationType: LRS
      exampleAadDiagnosticSetting:
        type: azure:monitoring:AadDiagnosticSetting
        properties:
          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

    new AadDiagnosticSetting(name: string, args?: AadDiagnosticSettingArgs, opts?: CustomResourceOptions);
    @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)
    @overload
    def AadDiagnosticSetting(resource_name: str,
                             args: Optional[AadDiagnosticSettingArgs] = None,
                             opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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
    

    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.49.0 published on Tuesday, Aug 29, 2023 by Pulumi