1. Packages
  2. Packages
  3. Azure Classic
  4. API Docs
  5. mssql
  6. Database

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Manages a MS SQL Database.

    Note: The Database Extended Auditing Policy can be set inline here, as well as with the mssql_database_extended_auditing_policy resource resource. You can only use one or the other and using both will cause a conflict.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
            {
                Location = "West Europe",
            });
            var exampleAccount = new Azure.Storage.Account("exampleAccount", new Azure.Storage.AccountArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                Location = exampleResourceGroup.Location,
                AccountTier = "Standard",
                AccountReplicationType = "LRS",
            });
            var exampleServer = new Azure.MSSql.Server("exampleServer", new Azure.MSSql.ServerArgs
            {
                ResourceGroupName = exampleResourceGroup.Name,
                Location = exampleResourceGroup.Location,
                Version = "12.0",
                AdministratorLogin = "4dm1n157r470r",
                AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd",
            });
            var test = new Azure.MSSql.Database("test", new Azure.MSSql.DatabaseArgs
            {
                ServerId = exampleServer.Id,
                Collation = "SQL_Latin1_General_CP1_CI_AS",
                LicenseType = "LicenseIncluded",
                MaxSizeGb = 4,
                ReadScale = true,
                SkuName = "BC_Gen5_2",
                ZoneRedundant = true,
                ExtendedAuditingPolicy = new Azure.MSSql.Inputs.DatabaseExtendedAuditingPolicyArgs
                {
                    StorageEndpoint = exampleAccount.PrimaryBlobEndpoint,
                    StorageAccountAccessKey = exampleAccount.PrimaryAccessKey,
                    StorageAccountAccessKeyIsSecondary = true,
                    RetentionInDays = 6,
                },
                Tags = 
                {
                    { "foo", "bar" },
                },
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/mssql"
    	"github.com/pulumi/pulumi-azure/sdk/v4/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"),
    			AccountReplicationType: pulumi.String("LRS"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{
    			ResourceGroupName:          exampleResourceGroup.Name,
    			Location:                   exampleResourceGroup.Location,
    			Version:                    pulumi.String("12.0"),
    			AdministratorLogin:         pulumi.String("4dm1n157r470r"),
    			AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = mssql.NewDatabase(ctx, "test", &mssql.DatabaseArgs{
    			ServerId:      exampleServer.ID(),
    			Collation:     pulumi.String("SQL_Latin1_General_CP1_CI_AS"),
    			LicenseType:   pulumi.String("LicenseIncluded"),
    			MaxSizeGb:     pulumi.Int(4),
    			ReadScale:     pulumi.Bool(true),
    			SkuName:       pulumi.String("BC_Gen5_2"),
    			ZoneRedundant: pulumi.Bool(true),
    			ExtendedAuditingPolicy: &mssql.DatabaseExtendedAuditingPolicyArgs{
    				StorageEndpoint:                    exampleAccount.PrimaryBlobEndpoint,
    				StorageAccountAccessKey:            exampleAccount.PrimaryAccessKey,
    				StorageAccountAccessKeyIsSecondary: pulumi.Bool(true),
    				RetentionInDays:                    pulumi.Int(6),
    			},
    			Tags: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    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",
        accountReplicationType: "LRS",
    });
    const exampleServer = new azure.mssql.Server("exampleServer", {
        resourceGroupName: exampleResourceGroup.name,
        location: exampleResourceGroup.location,
        version: "12.0",
        administratorLogin: "4dm1n157r470r",
        administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
    });
    const test = new azure.mssql.Database("test", {
        serverId: exampleServer.id,
        collation: "SQL_Latin1_General_CP1_CI_AS",
        licenseType: "LicenseIncluded",
        maxSizeGb: 4,
        readScale: true,
        skuName: "BC_Gen5_2",
        zoneRedundant: true,
        extendedAuditingPolicy: {
            storageEndpoint: exampleAccount.primaryBlobEndpoint,
            storageAccountAccessKey: exampleAccount.primaryAccessKey,
            storageAccountAccessKeyIsSecondary: true,
            retentionInDays: 6,
        },
        tags: {
            foo: "bar",
        },
    });
    
    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_replication_type="LRS")
    example_server = azure.mssql.Server("exampleServer",
        resource_group_name=example_resource_group.name,
        location=example_resource_group.location,
        version="12.0",
        administrator_login="4dm1n157r470r",
        administrator_login_password="4-v3ry-53cr37-p455w0rd")
    test = azure.mssql.Database("test",
        server_id=example_server.id,
        collation="SQL_Latin1_General_CP1_CI_AS",
        license_type="LicenseIncluded",
        max_size_gb=4,
        read_scale=True,
        sku_name="BC_Gen5_2",
        zone_redundant=True,
        extended_auditing_policy=azure.mssql.DatabaseExtendedAuditingPolicyArgs(
            storage_endpoint=example_account.primary_blob_endpoint,
            storage_account_access_key=example_account.primary_access_key,
            storage_account_access_key_is_secondary=True,
            retention_in_days=6,
        ),
        tags={
            "foo": "bar",
        })
    

    Example coming soon!

    Create Database Resource

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

    Constructor syntax

    new Database(name: string, args: DatabaseArgs, opts?: CustomResourceOptions);
    @overload
    def Database(resource_name: str,
                 args: DatabaseArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Database(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 server_id: Optional[str] = None,
                 geo_backup_enabled: Optional[bool] = None,
                 license_type: Optional[str] = None,
                 creation_source_database_id: Optional[str] = None,
                 elastic_pool_id: Optional[str] = None,
                 extended_auditing_policy: Optional[DatabaseExtendedAuditingPolicyArgs] = None,
                 auto_pause_delay_in_minutes: Optional[int] = None,
                 read_replica_count: Optional[int] = None,
                 long_term_retention_policy: Optional[DatabaseLongTermRetentionPolicyArgs] = None,
                 max_size_gb: Optional[int] = None,
                 min_capacity: Optional[float] = None,
                 create_mode: Optional[str] = None,
                 name: Optional[str] = None,
                 sample_name: Optional[str] = None,
                 recover_database_id: Optional[str] = None,
                 restore_dropped_database_id: Optional[str] = None,
                 restore_point_in_time: Optional[str] = None,
                 read_scale: Optional[bool] = None,
                 collation: Optional[str] = None,
                 short_term_retention_policy: Optional[DatabaseShortTermRetentionPolicyArgs] = None,
                 sku_name: Optional[str] = None,
                 storage_account_type: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 threat_detection_policy: Optional[DatabaseThreatDetectionPolicyArgs] = None,
                 zone_redundant: Optional[bool] = None)
    func NewDatabase(ctx *Context, name string, args DatabaseArgs, opts ...ResourceOption) (*Database, error)
    public Database(string name, DatabaseArgs args, CustomResourceOptions? opts = null)
    public Database(String name, DatabaseArgs args)
    public Database(String name, DatabaseArgs args, CustomResourceOptions options)
    
    type: azure:mssql:Database
    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 DatabaseArgs
    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 DatabaseArgs
    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 DatabaseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DatabaseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DatabaseArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

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

    var exampledatabaseResourceResourceFromMssqldatabase = new Azure.MSSql.Database("exampledatabaseResourceResourceFromMssqldatabase", new()
    {
        ServerId = "string",
        GeoBackupEnabled = false,
        LicenseType = "string",
        CreationSourceDatabaseId = "string",
        ElasticPoolId = "string",
        AutoPauseDelayInMinutes = 0,
        ReadReplicaCount = 0,
        LongTermRetentionPolicy = new Azure.MSSql.Inputs.DatabaseLongTermRetentionPolicyArgs
        {
            MonthlyRetention = "string",
            WeekOfYear = 0,
            WeeklyRetention = "string",
            YearlyRetention = "string",
        },
        MaxSizeGb = 0,
        MinCapacity = 0,
        CreateMode = "string",
        Name = "string",
        SampleName = "string",
        RecoverDatabaseId = "string",
        RestoreDroppedDatabaseId = "string",
        RestorePointInTime = "string",
        ReadScale = false,
        Collation = "string",
        ShortTermRetentionPolicy = new Azure.MSSql.Inputs.DatabaseShortTermRetentionPolicyArgs
        {
            RetentionDays = 0,
        },
        SkuName = "string",
        StorageAccountType = "string",
        Tags = 
        {
            { "string", "string" },
        },
        ThreatDetectionPolicy = new Azure.MSSql.Inputs.DatabaseThreatDetectionPolicyArgs
        {
            DisabledAlerts = new[]
            {
                "string",
            },
            EmailAccountAdmins = "string",
            EmailAddresses = new[]
            {
                "string",
            },
            RetentionDays = 0,
            State = "string",
            StorageAccountAccessKey = "string",
            StorageEndpoint = "string",
        },
        ZoneRedundant = false,
    });
    
    example, err := mssql.NewDatabase(ctx, "exampledatabaseResourceResourceFromMssqldatabase", &mssql.DatabaseArgs{
    	ServerId:                 pulumi.String("string"),
    	GeoBackupEnabled:         pulumi.Bool(false),
    	LicenseType:              pulumi.String("string"),
    	CreationSourceDatabaseId: pulumi.String("string"),
    	ElasticPoolId:            pulumi.String("string"),
    	AutoPauseDelayInMinutes:  pulumi.Int(0),
    	ReadReplicaCount:         pulumi.Int(0),
    	LongTermRetentionPolicy: &mssql.DatabaseLongTermRetentionPolicyArgs{
    		MonthlyRetention: pulumi.String("string"),
    		WeekOfYear:       pulumi.Int(0),
    		WeeklyRetention:  pulumi.String("string"),
    		YearlyRetention:  pulumi.String("string"),
    	},
    	MaxSizeGb:                pulumi.Int(0),
    	MinCapacity:              pulumi.Float64(0),
    	CreateMode:               pulumi.String("string"),
    	Name:                     pulumi.String("string"),
    	SampleName:               pulumi.String("string"),
    	RecoverDatabaseId:        pulumi.String("string"),
    	RestoreDroppedDatabaseId: pulumi.String("string"),
    	RestorePointInTime:       pulumi.String("string"),
    	ReadScale:                pulumi.Bool(false),
    	Collation:                pulumi.String("string"),
    	ShortTermRetentionPolicy: &mssql.DatabaseShortTermRetentionPolicyArgs{
    		RetentionDays: pulumi.Int(0),
    	},
    	SkuName:            pulumi.String("string"),
    	StorageAccountType: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	ThreatDetectionPolicy: &mssql.DatabaseThreatDetectionPolicyArgs{
    		DisabledAlerts: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		EmailAccountAdmins: pulumi.String("string"),
    		EmailAddresses: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		RetentionDays:           pulumi.Int(0),
    		State:                   pulumi.String("string"),
    		StorageAccountAccessKey: pulumi.String("string"),
    		StorageEndpoint:         pulumi.String("string"),
    	},
    	ZoneRedundant: pulumi.Bool(false),
    })
    
    var exampledatabaseResourceResourceFromMssqldatabase = new com.pulumi.azure.mssql.Database("exampledatabaseResourceResourceFromMssqldatabase", com.pulumi.azure.mssql.DatabaseArgs.builder()
        .serverId("string")
        .geoBackupEnabled(false)
        .licenseType("string")
        .creationSourceDatabaseId("string")
        .elasticPoolId("string")
        .autoPauseDelayInMinutes(0)
        .readReplicaCount(0)
        .longTermRetentionPolicy(DatabaseLongTermRetentionPolicyArgs.builder()
            .monthlyRetention("string")
            .weekOfYear(0)
            .weeklyRetention("string")
            .yearlyRetention("string")
            .build())
        .maxSizeGb(0)
        .minCapacity(0.0)
        .createMode("string")
        .name("string")
        .sampleName("string")
        .recoverDatabaseId("string")
        .restoreDroppedDatabaseId("string")
        .restorePointInTime("string")
        .readScale(false)
        .collation("string")
        .shortTermRetentionPolicy(DatabaseShortTermRetentionPolicyArgs.builder()
            .retentionDays(0)
            .build())
        .skuName("string")
        .storageAccountType("string")
        .tags(Map.of("string", "string"))
        .threatDetectionPolicy(DatabaseThreatDetectionPolicyArgs.builder()
            .disabledAlerts("string")
            .emailAccountAdmins("string")
            .emailAddresses("string")
            .retentionDays(0)
            .state("string")
            .storageAccountAccessKey("string")
            .storageEndpoint("string")
            .build())
        .zoneRedundant(false)
        .build());
    
    exampledatabase_resource_resource_from_mssqldatabase = azure.mssql.Database("exampledatabaseResourceResourceFromMssqldatabase",
        server_id="string",
        geo_backup_enabled=False,
        license_type="string",
        creation_source_database_id="string",
        elastic_pool_id="string",
        auto_pause_delay_in_minutes=0,
        read_replica_count=0,
        long_term_retention_policy={
            "monthly_retention": "string",
            "week_of_year": 0,
            "weekly_retention": "string",
            "yearly_retention": "string",
        },
        max_size_gb=0,
        min_capacity=0,
        create_mode="string",
        name="string",
        sample_name="string",
        recover_database_id="string",
        restore_dropped_database_id="string",
        restore_point_in_time="string",
        read_scale=False,
        collation="string",
        short_term_retention_policy={
            "retention_days": 0,
        },
        sku_name="string",
        storage_account_type="string",
        tags={
            "string": "string",
        },
        threat_detection_policy={
            "disabled_alerts": ["string"],
            "email_account_admins": "string",
            "email_addresses": ["string"],
            "retention_days": 0,
            "state": "string",
            "storage_account_access_key": "string",
            "storage_endpoint": "string",
        },
        zone_redundant=False)
    
    const exampledatabaseResourceResourceFromMssqldatabase = new azure.mssql.Database("exampledatabaseResourceResourceFromMssqldatabase", {
        serverId: "string",
        geoBackupEnabled: false,
        licenseType: "string",
        creationSourceDatabaseId: "string",
        elasticPoolId: "string",
        autoPauseDelayInMinutes: 0,
        readReplicaCount: 0,
        longTermRetentionPolicy: {
            monthlyRetention: "string",
            weekOfYear: 0,
            weeklyRetention: "string",
            yearlyRetention: "string",
        },
        maxSizeGb: 0,
        minCapacity: 0,
        createMode: "string",
        name: "string",
        sampleName: "string",
        recoverDatabaseId: "string",
        restoreDroppedDatabaseId: "string",
        restorePointInTime: "string",
        readScale: false,
        collation: "string",
        shortTermRetentionPolicy: {
            retentionDays: 0,
        },
        skuName: "string",
        storageAccountType: "string",
        tags: {
            string: "string",
        },
        threatDetectionPolicy: {
            disabledAlerts: ["string"],
            emailAccountAdmins: "string",
            emailAddresses: ["string"],
            retentionDays: 0,
            state: "string",
            storageAccountAccessKey: "string",
            storageEndpoint: "string",
        },
        zoneRedundant: false,
    });
    
    type: azure:mssql:Database
    properties:
        autoPauseDelayInMinutes: 0
        collation: string
        createMode: string
        creationSourceDatabaseId: string
        elasticPoolId: string
        geoBackupEnabled: false
        licenseType: string
        longTermRetentionPolicy:
            monthlyRetention: string
            weekOfYear: 0
            weeklyRetention: string
            yearlyRetention: string
        maxSizeGb: 0
        minCapacity: 0
        name: string
        readReplicaCount: 0
        readScale: false
        recoverDatabaseId: string
        restoreDroppedDatabaseId: string
        restorePointInTime: string
        sampleName: string
        serverId: string
        shortTermRetentionPolicy:
            retentionDays: 0
        skuName: string
        storageAccountType: string
        tags:
            string: string
        threatDetectionPolicy:
            disabledAlerts:
                - string
            emailAccountAdmins: string
            emailAddresses:
                - string
            retentionDays: 0
            state: string
            storageAccountAccessKey: string
            storageEndpoint: string
        zoneRedundant: false
    

    Database Resource Properties

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

    Inputs

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

    The Database resource accepts the following input properties:

    ServerId string
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    AutoPauseDelayInMinutes int
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    Collation string
    Specifies the collation of the database. Changing this forces a new resource to be created.
    CreateMode string
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    CreationSourceDatabaseId string
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    ElasticPoolId string
    Specifies the ID of the elastic pool containing this database.
    ExtendedAuditingPolicy DatabaseExtendedAuditingPolicy
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    GeoBackupEnabled bool
    A boolean that specifies if the Geo Backup Policy is enabled.
    LicenseType string
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    LongTermRetentionPolicy DatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    MaxSizeGb int
    The max size of the database in gigabytes.
    MinCapacity double
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    Name string
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    ReadReplicaCount int
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    ReadScale bool
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    RecoverDatabaseId string
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    RestoreDroppedDatabaseId string
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    RestorePointInTime string
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    SampleName string
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    ShortTermRetentionPolicy DatabaseShortTermRetentionPolicy
    A short_term_retention_policy block as defined below.
    SkuName string
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    StorageAccountType string
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    ThreatDetectionPolicy DatabaseThreatDetectionPolicy
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    ZoneRedundant bool
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    ServerId string
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    AutoPauseDelayInMinutes int
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    Collation string
    Specifies the collation of the database. Changing this forces a new resource to be created.
    CreateMode string
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    CreationSourceDatabaseId string
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    ElasticPoolId string
    Specifies the ID of the elastic pool containing this database.
    ExtendedAuditingPolicy DatabaseExtendedAuditingPolicyTypeArgs
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    GeoBackupEnabled bool
    A boolean that specifies if the Geo Backup Policy is enabled.
    LicenseType string
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    LongTermRetentionPolicy DatabaseLongTermRetentionPolicyArgs
    A long_term_retention_policy block as defined below.
    MaxSizeGb int
    The max size of the database in gigabytes.
    MinCapacity float64
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    Name string
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    ReadReplicaCount int
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    ReadScale bool
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    RecoverDatabaseId string
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    RestoreDroppedDatabaseId string
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    RestorePointInTime string
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    SampleName string
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    ShortTermRetentionPolicy DatabaseShortTermRetentionPolicyArgs
    A short_term_retention_policy block as defined below.
    SkuName string
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    StorageAccountType string
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    ThreatDetectionPolicy DatabaseThreatDetectionPolicyArgs
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    ZoneRedundant bool
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    serverId String
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    autoPauseDelayInMinutes Integer
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    collation String
    Specifies the collation of the database. Changing this forces a new resource to be created.
    createMode String
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    creationSourceDatabaseId String
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    elasticPoolId String
    Specifies the ID of the elastic pool containing this database.
    extendedAuditingPolicy DatabaseExtendedAuditingPolicy
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    geoBackupEnabled Boolean
    A boolean that specifies if the Geo Backup Policy is enabled.
    licenseType String
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    longTermRetentionPolicy DatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    maxSizeGb Integer
    The max size of the database in gigabytes.
    minCapacity Double
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    name String
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    readReplicaCount Integer
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    readScale Boolean
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    recoverDatabaseId String
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    restoreDroppedDatabaseId String
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    restorePointInTime String
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    sampleName String
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    shortTermRetentionPolicy DatabaseShortTermRetentionPolicy
    A short_term_retention_policy block as defined below.
    skuName String
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    storageAccountType String
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    threatDetectionPolicy DatabaseThreatDetectionPolicy
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    zoneRedundant Boolean
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    serverId string
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    autoPauseDelayInMinutes number
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    collation string
    Specifies the collation of the database. Changing this forces a new resource to be created.
    createMode string
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    creationSourceDatabaseId string
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    elasticPoolId string
    Specifies the ID of the elastic pool containing this database.
    extendedAuditingPolicy DatabaseExtendedAuditingPolicy
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    geoBackupEnabled boolean
    A boolean that specifies if the Geo Backup Policy is enabled.
    licenseType string
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    longTermRetentionPolicy DatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    maxSizeGb number
    The max size of the database in gigabytes.
    minCapacity number
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    name string
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    readReplicaCount number
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    readScale boolean
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    recoverDatabaseId string
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    restoreDroppedDatabaseId string
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    restorePointInTime string
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    sampleName string
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    shortTermRetentionPolicy DatabaseShortTermRetentionPolicy
    A short_term_retention_policy block as defined below.
    skuName string
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    storageAccountType string
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    threatDetectionPolicy DatabaseThreatDetectionPolicy
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    zoneRedundant boolean
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    server_id str
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    auto_pause_delay_in_minutes int
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    collation str
    Specifies the collation of the database. Changing this forces a new resource to be created.
    create_mode str
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    creation_source_database_id str
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    elastic_pool_id str
    Specifies the ID of the elastic pool containing this database.
    extended_auditing_policy DatabaseExtendedAuditingPolicyArgs
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    geo_backup_enabled bool
    A boolean that specifies if the Geo Backup Policy is enabled.
    license_type str
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    long_term_retention_policy DatabaseLongTermRetentionPolicyArgs
    A long_term_retention_policy block as defined below.
    max_size_gb int
    The max size of the database in gigabytes.
    min_capacity float
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    name str
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    read_replica_count int
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    read_scale bool
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    recover_database_id str
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    restore_dropped_database_id str
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    restore_point_in_time str
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    sample_name str
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    short_term_retention_policy DatabaseShortTermRetentionPolicyArgs
    A short_term_retention_policy block as defined below.
    sku_name str
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    storage_account_type str
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    threat_detection_policy DatabaseThreatDetectionPolicyArgs
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    zone_redundant bool
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    serverId String
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    autoPauseDelayInMinutes Number
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    collation String
    Specifies the collation of the database. Changing this forces a new resource to be created.
    createMode String
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    creationSourceDatabaseId String
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    elasticPoolId String
    Specifies the ID of the elastic pool containing this database.
    extendedAuditingPolicy Property Map
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    geoBackupEnabled Boolean
    A boolean that specifies if the Geo Backup Policy is enabled.
    licenseType String
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    longTermRetentionPolicy Property Map
    A long_term_retention_policy block as defined below.
    maxSizeGb Number
    The max size of the database in gigabytes.
    minCapacity Number
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    name String
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    readReplicaCount Number
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    readScale Boolean
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    recoverDatabaseId String
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    restoreDroppedDatabaseId String
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    restorePointInTime String
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    sampleName String
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    shortTermRetentionPolicy Property Map
    A short_term_retention_policy block as defined below.
    skuName String
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    storageAccountType String
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    tags Map<String>
    A mapping of tags to assign to the resource.
    threatDetectionPolicy Property Map
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    zoneRedundant Boolean
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.

    Outputs

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

    Get an existing Database 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?: DatabaseState, opts?: CustomResourceOptions): Database
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_pause_delay_in_minutes: Optional[int] = None,
            collation: Optional[str] = None,
            create_mode: Optional[str] = None,
            creation_source_database_id: Optional[str] = None,
            elastic_pool_id: Optional[str] = None,
            extended_auditing_policy: Optional[DatabaseExtendedAuditingPolicyArgs] = None,
            geo_backup_enabled: Optional[bool] = None,
            license_type: Optional[str] = None,
            long_term_retention_policy: Optional[DatabaseLongTermRetentionPolicyArgs] = None,
            max_size_gb: Optional[int] = None,
            min_capacity: Optional[float] = None,
            name: Optional[str] = None,
            read_replica_count: Optional[int] = None,
            read_scale: Optional[bool] = None,
            recover_database_id: Optional[str] = None,
            restore_dropped_database_id: Optional[str] = None,
            restore_point_in_time: Optional[str] = None,
            sample_name: Optional[str] = None,
            server_id: Optional[str] = None,
            short_term_retention_policy: Optional[DatabaseShortTermRetentionPolicyArgs] = None,
            sku_name: Optional[str] = None,
            storage_account_type: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            threat_detection_policy: Optional[DatabaseThreatDetectionPolicyArgs] = None,
            zone_redundant: Optional[bool] = None) -> Database
    func GetDatabase(ctx *Context, name string, id IDInput, state *DatabaseState, opts ...ResourceOption) (*Database, error)
    public static Database Get(string name, Input<string> id, DatabaseState? state, CustomResourceOptions? opts = null)
    public static Database get(String name, Output<String> id, DatabaseState state, CustomResourceOptions options)
    resources:  _:    type: azure:mssql:Database    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AutoPauseDelayInMinutes int
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    Collation string
    Specifies the collation of the database. Changing this forces a new resource to be created.
    CreateMode string
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    CreationSourceDatabaseId string
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    ElasticPoolId string
    Specifies the ID of the elastic pool containing this database.
    ExtendedAuditingPolicy DatabaseExtendedAuditingPolicy
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    GeoBackupEnabled bool
    A boolean that specifies if the Geo Backup Policy is enabled.
    LicenseType string
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    LongTermRetentionPolicy DatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    MaxSizeGb int
    The max size of the database in gigabytes.
    MinCapacity double
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    Name string
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    ReadReplicaCount int
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    ReadScale bool
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    RecoverDatabaseId string
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    RestoreDroppedDatabaseId string
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    RestorePointInTime string
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    SampleName string
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    ServerId string
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    ShortTermRetentionPolicy DatabaseShortTermRetentionPolicy
    A short_term_retention_policy block as defined below.
    SkuName string
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    StorageAccountType string
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    ThreatDetectionPolicy DatabaseThreatDetectionPolicy
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    ZoneRedundant bool
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    AutoPauseDelayInMinutes int
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    Collation string
    Specifies the collation of the database. Changing this forces a new resource to be created.
    CreateMode string
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    CreationSourceDatabaseId string
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    ElasticPoolId string
    Specifies the ID of the elastic pool containing this database.
    ExtendedAuditingPolicy DatabaseExtendedAuditingPolicyTypeArgs
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    GeoBackupEnabled bool
    A boolean that specifies if the Geo Backup Policy is enabled.
    LicenseType string
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    LongTermRetentionPolicy DatabaseLongTermRetentionPolicyArgs
    A long_term_retention_policy block as defined below.
    MaxSizeGb int
    The max size of the database in gigabytes.
    MinCapacity float64
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    Name string
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    ReadReplicaCount int
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    ReadScale bool
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    RecoverDatabaseId string
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    RestoreDroppedDatabaseId string
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    RestorePointInTime string
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    SampleName string
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    ServerId string
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    ShortTermRetentionPolicy DatabaseShortTermRetentionPolicyArgs
    A short_term_retention_policy block as defined below.
    SkuName string
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    StorageAccountType string
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    ThreatDetectionPolicy DatabaseThreatDetectionPolicyArgs
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    ZoneRedundant bool
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    autoPauseDelayInMinutes Integer
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    collation String
    Specifies the collation of the database. Changing this forces a new resource to be created.
    createMode String
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    creationSourceDatabaseId String
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    elasticPoolId String
    Specifies the ID of the elastic pool containing this database.
    extendedAuditingPolicy DatabaseExtendedAuditingPolicy
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    geoBackupEnabled Boolean
    A boolean that specifies if the Geo Backup Policy is enabled.
    licenseType String
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    longTermRetentionPolicy DatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    maxSizeGb Integer
    The max size of the database in gigabytes.
    minCapacity Double
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    name String
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    readReplicaCount Integer
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    readScale Boolean
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    recoverDatabaseId String
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    restoreDroppedDatabaseId String
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    restorePointInTime String
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    sampleName String
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    serverId String
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    shortTermRetentionPolicy DatabaseShortTermRetentionPolicy
    A short_term_retention_policy block as defined below.
    skuName String
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    storageAccountType String
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    threatDetectionPolicy DatabaseThreatDetectionPolicy
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    zoneRedundant Boolean
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    autoPauseDelayInMinutes number
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    collation string
    Specifies the collation of the database. Changing this forces a new resource to be created.
    createMode string
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    creationSourceDatabaseId string
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    elasticPoolId string
    Specifies the ID of the elastic pool containing this database.
    extendedAuditingPolicy DatabaseExtendedAuditingPolicy
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    geoBackupEnabled boolean
    A boolean that specifies if the Geo Backup Policy is enabled.
    licenseType string
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    longTermRetentionPolicy DatabaseLongTermRetentionPolicy
    A long_term_retention_policy block as defined below.
    maxSizeGb number
    The max size of the database in gigabytes.
    minCapacity number
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    name string
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    readReplicaCount number
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    readScale boolean
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    recoverDatabaseId string
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    restoreDroppedDatabaseId string
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    restorePointInTime string
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    sampleName string
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    serverId string
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    shortTermRetentionPolicy DatabaseShortTermRetentionPolicy
    A short_term_retention_policy block as defined below.
    skuName string
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    storageAccountType string
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    threatDetectionPolicy DatabaseThreatDetectionPolicy
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    zoneRedundant boolean
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    auto_pause_delay_in_minutes int
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    collation str
    Specifies the collation of the database. Changing this forces a new resource to be created.
    create_mode str
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    creation_source_database_id str
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    elastic_pool_id str
    Specifies the ID of the elastic pool containing this database.
    extended_auditing_policy DatabaseExtendedAuditingPolicyArgs
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    geo_backup_enabled bool
    A boolean that specifies if the Geo Backup Policy is enabled.
    license_type str
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    long_term_retention_policy DatabaseLongTermRetentionPolicyArgs
    A long_term_retention_policy block as defined below.
    max_size_gb int
    The max size of the database in gigabytes.
    min_capacity float
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    name str
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    read_replica_count int
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    read_scale bool
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    recover_database_id str
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    restore_dropped_database_id str
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    restore_point_in_time str
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    sample_name str
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    server_id str
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    short_term_retention_policy DatabaseShortTermRetentionPolicyArgs
    A short_term_retention_policy block as defined below.
    sku_name str
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    storage_account_type str
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    threat_detection_policy DatabaseThreatDetectionPolicyArgs
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    zone_redundant bool
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.
    autoPauseDelayInMinutes Number
    Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. This property is only settable for General Purpose Serverless databases.
    collation String
    Specifies the collation of the database. Changing this forces a new resource to be created.
    createMode String
    The create mode of the database. Possible values are Copy, Default, OnlineSecondary, PointInTimeRestore, Recovery, Restore, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup and Secondary.
    creationSourceDatabaseId String
    The ID of the source database from which to create the new database. This should only be used for databases with create_mode values that use another database as reference. Changing this forces a new resource to be created.
    elasticPoolId String
    Specifies the ID of the elastic pool containing this database.
    extendedAuditingPolicy Property Map
    A extended_auditing_policy block as defined below.

    Deprecated: the extended_auditing_policy block has been moved to azurerm_mssql_server_extended_auditing_policy and azurerm_mssql_database_extended_auditing_policy. This block will be removed in version 3.0 of the provider.

    geoBackupEnabled Boolean
    A boolean that specifies if the Geo Backup Policy is enabled.
    licenseType String
    Specifies the license type applied to this database. Possible values are LicenseIncluded and BasePrice.
    longTermRetentionPolicy Property Map
    A long_term_retention_policy block as defined below.
    maxSizeGb Number
    The max size of the database in gigabytes.
    minCapacity Number
    Minimal capacity that database will always have allocated, if not paused. This property is only settable for General Purpose Serverless databases.
    name String
    The name of the Ms SQL Database. Changing this forces a new resource to be created.
    readReplicaCount Number
    The number of readonly secondary replicas associated with the database to which readonly application intent connections may be routed. This property is only settable for Hyperscale edition databases.
    readScale Boolean
    If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica. This property is only settable for Premium and Business Critical databases.
    recoverDatabaseId String
    The ID of the database to be recovered. This property is only applicable when the create_mode is Recovery.
    restoreDroppedDatabaseId String
    The ID of the database to be restored. This property is only applicable when the create_mode is Restore.
    restorePointInTime String
    Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. This property is only settable for create_mode= PointInTimeRestore databases.
    sampleName String
    Specifies the name of the sample schema to apply when creating this database. Possible value is AdventureWorksLT.
    serverId String
    The id of the Ms SQL Server on which to create the database. Changing this forces a new resource to be created.
    shortTermRetentionPolicy Property Map
    A short_term_retention_policy block as defined below.
    skuName String
    Specifies the name of the SKU used by the database. For example, GP_S_Gen5_2,HS_Gen4_1,BC_Gen5_2, ElasticPool, Basic,S0, P2 ,DW100c, DS100. Changing this from the HyperScale service tier to another service tier will force a new resource to be created.
    storageAccountType String
    Specifies the storage account type used to store backups for this database. Changing this forces a new resource to be created. Possible values are GRS, LRS and ZRS. The default value is GRS.
    tags Map<String>
    A mapping of tags to assign to the resource.
    threatDetectionPolicy Property Map
    Threat detection policy configuration. The threat_detection_policy block supports fields documented below.
    zoneRedundant Boolean
    Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. This property is only settable for Premium and Business Critical databases.

    Supporting Types

    DatabaseExtendedAuditingPolicy, DatabaseExtendedAuditingPolicyArgs

    LogMonitoringEnabled bool
    RetentionInDays int
    Specifies the number of days to retain logs for in the storage account.
    StorageAccountAccessKey string
    Specifies the access key to use for the auditing storage account.
    StorageAccountAccessKeyIsSecondary bool
    Specifies whether storage_account_access_key value is the storage's secondary key.
    StorageAccountSubscriptionId string
    StorageEndpoint string
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net).
    LogMonitoringEnabled bool
    RetentionInDays int
    Specifies the number of days to retain logs for in the storage account.
    StorageAccountAccessKey string
    Specifies the access key to use for the auditing storage account.
    StorageAccountAccessKeyIsSecondary bool
    Specifies whether storage_account_access_key value is the storage's secondary key.
    StorageAccountSubscriptionId string
    StorageEndpoint string
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net).
    logMonitoringEnabled Boolean
    retentionInDays Integer
    Specifies the number of days to retain logs for in the storage account.
    storageAccountAccessKey String
    Specifies the access key to use for the auditing storage account.
    storageAccountAccessKeyIsSecondary Boolean
    Specifies whether storage_account_access_key value is the storage's secondary key.
    storageAccountSubscriptionId String
    storageEndpoint String
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net).
    logMonitoringEnabled boolean
    retentionInDays number
    Specifies the number of days to retain logs for in the storage account.
    storageAccountAccessKey string
    Specifies the access key to use for the auditing storage account.
    storageAccountAccessKeyIsSecondary boolean
    Specifies whether storage_account_access_key value is the storage's secondary key.
    storageAccountSubscriptionId string
    storageEndpoint string
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net).
    log_monitoring_enabled bool
    retention_in_days int
    Specifies the number of days to retain logs for in the storage account.
    storage_account_access_key str
    Specifies the access key to use for the auditing storage account.
    storage_account_access_key_is_secondary bool
    Specifies whether storage_account_access_key value is the storage's secondary key.
    storage_account_subscription_id str
    storage_endpoint str
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net).
    logMonitoringEnabled Boolean
    retentionInDays Number
    Specifies the number of days to retain logs for in the storage account.
    storageAccountAccessKey String
    Specifies the access key to use for the auditing storage account.
    storageAccountAccessKeyIsSecondary Boolean
    Specifies whether storage_account_access_key value is the storage's secondary key.
    storageAccountSubscriptionId String
    storageEndpoint String
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net).

    DatabaseLongTermRetentionPolicy, DatabaseLongTermRetentionPolicyArgs

    MonthlyRetention string
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    WeekOfYear int
    The week of year to take the yearly backup in an ISO 8601 format. Value has to be between 1 and 52.
    WeeklyRetention string
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    YearlyRetention string
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    MonthlyRetention string
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    WeekOfYear int
    The week of year to take the yearly backup in an ISO 8601 format. Value has to be between 1 and 52.
    WeeklyRetention string
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    YearlyRetention string
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    monthlyRetention String
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    weekOfYear Integer
    The week of year to take the yearly backup in an ISO 8601 format. Value has to be between 1 and 52.
    weeklyRetention String
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    yearlyRetention String
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    monthlyRetention string
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    weekOfYear number
    The week of year to take the yearly backup in an ISO 8601 format. Value has to be between 1 and 52.
    weeklyRetention string
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    yearlyRetention string
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    monthly_retention str
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    week_of_year int
    The week of year to take the yearly backup in an ISO 8601 format. Value has to be between 1 and 52.
    weekly_retention str
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    yearly_retention str
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.
    monthlyRetention String
    The monthly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 120 months. e.g. P1Y, P1M, P4W or P30D.
    weekOfYear Number
    The week of year to take the yearly backup in an ISO 8601 format. Value has to be between 1 and 52.
    weeklyRetention String
    The weekly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 520 weeks. e.g. P1Y, P1M, P1W or P7D.
    yearlyRetention String
    The yearly retention policy for an LTR backup in an ISO 8601 format. Valid value is between 1 to 10 years. e.g. P1Y, P12M, P52W or P365D.

    DatabaseShortTermRetentionPolicy, DatabaseShortTermRetentionPolicyArgs

    RetentionDays int
    Point In Time Restore configuration. Value has to be between 7 and 35.
    RetentionDays int
    Point In Time Restore configuration. Value has to be between 7 and 35.
    retentionDays Integer
    Point In Time Restore configuration. Value has to be between 7 and 35.
    retentionDays number
    Point In Time Restore configuration. Value has to be between 7 and 35.
    retention_days int
    Point In Time Restore configuration. Value has to be between 7 and 35.
    retentionDays Number
    Point In Time Restore configuration. Value has to be between 7 and 35.

    DatabaseThreatDetectionPolicy, DatabaseThreatDetectionPolicyArgs

    DisabledAlerts List<string>
    Specifies a list of alerts which should be disabled. Possible values include Access_Anomaly, Sql_Injection and Sql_Injection_Vulnerability.
    EmailAccountAdmins string
    Should the account administrators be emailed when this alert is triggered?
    EmailAddresses List<string>
    A list of email addresses which alerts should be sent to.
    RetentionDays int
    Specifies the number of days to keep in the Threat Detection audit logs.
    State string
    The State of the Policy. Possible values are Enabled, Disabled or New.
    StorageAccountAccessKey string
    Specifies the identifier key of the Threat Detection audit storage account. Required if state is Enabled.
    StorageEndpoint string
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if state is Enabled.
    UseServerDefault string

    Deprecated: This field is now non-functional and thus will be removed in version 3.0 of the Azure Provider

    DisabledAlerts []string
    Specifies a list of alerts which should be disabled. Possible values include Access_Anomaly, Sql_Injection and Sql_Injection_Vulnerability.
    EmailAccountAdmins string
    Should the account administrators be emailed when this alert is triggered?
    EmailAddresses []string
    A list of email addresses which alerts should be sent to.
    RetentionDays int
    Specifies the number of days to keep in the Threat Detection audit logs.
    State string
    The State of the Policy. Possible values are Enabled, Disabled or New.
    StorageAccountAccessKey string
    Specifies the identifier key of the Threat Detection audit storage account. Required if state is Enabled.
    StorageEndpoint string
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if state is Enabled.
    UseServerDefault string

    Deprecated: This field is now non-functional and thus will be removed in version 3.0 of the Azure Provider

    disabledAlerts List<String>
    Specifies a list of alerts which should be disabled. Possible values include Access_Anomaly, Sql_Injection and Sql_Injection_Vulnerability.
    emailAccountAdmins String
    Should the account administrators be emailed when this alert is triggered?
    emailAddresses List<String>
    A list of email addresses which alerts should be sent to.
    retentionDays Integer
    Specifies the number of days to keep in the Threat Detection audit logs.
    state String
    The State of the Policy. Possible values are Enabled, Disabled or New.
    storageAccountAccessKey String
    Specifies the identifier key of the Threat Detection audit storage account. Required if state is Enabled.
    storageEndpoint String
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if state is Enabled.
    useServerDefault String

    Deprecated: This field is now non-functional and thus will be removed in version 3.0 of the Azure Provider

    disabledAlerts string[]
    Specifies a list of alerts which should be disabled. Possible values include Access_Anomaly, Sql_Injection and Sql_Injection_Vulnerability.
    emailAccountAdmins string
    Should the account administrators be emailed when this alert is triggered?
    emailAddresses string[]
    A list of email addresses which alerts should be sent to.
    retentionDays number
    Specifies the number of days to keep in the Threat Detection audit logs.
    state string
    The State of the Policy. Possible values are Enabled, Disabled or New.
    storageAccountAccessKey string
    Specifies the identifier key of the Threat Detection audit storage account. Required if state is Enabled.
    storageEndpoint string
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if state is Enabled.
    useServerDefault string

    Deprecated: This field is now non-functional and thus will be removed in version 3.0 of the Azure Provider

    disabled_alerts Sequence[str]
    Specifies a list of alerts which should be disabled. Possible values include Access_Anomaly, Sql_Injection and Sql_Injection_Vulnerability.
    email_account_admins str
    Should the account administrators be emailed when this alert is triggered?
    email_addresses Sequence[str]
    A list of email addresses which alerts should be sent to.
    retention_days int
    Specifies the number of days to keep in the Threat Detection audit logs.
    state str
    The State of the Policy. Possible values are Enabled, Disabled or New.
    storage_account_access_key str
    Specifies the identifier key of the Threat Detection audit storage account. Required if state is Enabled.
    storage_endpoint str
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if state is Enabled.
    use_server_default str

    Deprecated: This field is now non-functional and thus will be removed in version 3.0 of the Azure Provider

    disabledAlerts List<String>
    Specifies a list of alerts which should be disabled. Possible values include Access_Anomaly, Sql_Injection and Sql_Injection_Vulnerability.
    emailAccountAdmins String
    Should the account administrators be emailed when this alert is triggered?
    emailAddresses List<String>
    A list of email addresses which alerts should be sent to.
    retentionDays Number
    Specifies the number of days to keep in the Threat Detection audit logs.
    state String
    The State of the Policy. Possible values are Enabled, Disabled or New.
    storageAccountAccessKey String
    Specifies the identifier key of the Threat Detection audit storage account. Required if state is Enabled.
    storageEndpoint String
    Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if state is Enabled.
    useServerDefault String

    Deprecated: This field is now non-functional and thus will be removed in version 3.0 of the Azure Provider

    Import

    SQL Database can be imported using the resource id, e.g.

     $ pulumi import azure:mssql/database:Database example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/example1
    

    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.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial