Skip to main content

azSqlDatabase

Deploy an Azure SQL Database to the relevant subscription.

Attributes

AttributeTypeMandatoryValuesDefaultNotes
NameStringYes
ResourceGroupNameStringYes
ServerNameStringYes
ElasticPoolNameStringNo
DtuModelObject** Either DtuModel or VCoreModel is mandatory
VCoreModelObject** Either DtuModel or VCoreModel is mandatory
ServiceObjectiveNameStringNoEdition: Free - Free
Edition: Basic - Basic
Edition: Standard - S0
Edition: Premium - P0
Edition: DataWarehouse - DW100c
Edition: Stretch - DS100
CollationNameStringNo
CatalogCollationStringNo
ReadScaleStringNo
ComputeModelStringNo
AutoPauseDelayInMinutesNumberNo
MinimumCapacityStringNo
BackupStorageRedundancyStringNoLocal, Zone, Geo, GeoZone
EnableLedgerStringNo
MaxSizeBytesNumberNo
SecondaryTypeStringNoGeo, Named
FailoverGroupStringNo
AutotuningObjectNo
DiagnosticObjectNo
AuditObjectNo
ReplicaObjectNo
TagObjectNo
LockObjectNo

Dtu Model

The DTU model for measuring capacity has several potential editions.

AttributeTypeMandatoryValuesDefaultNotes
EditionString*Free* Either DtuModel or VCoreModel is mandatory
Basic
Standard
Premium
Premium
DataWarehouse
Stretch
DtuNumber

VCore Model

AttributeTypeMandatoryValuesDefaultNotes
EditionString*GeneralPurpose* Either DtuModel or VCoreModel is mandatory
BusinessCritical
Hyperscale
VCoreNumberYes
ComputeGenerationStringNoGen5 (D), FSv2, DC, M
HighAvailabilityReplicaCountNumberNoOnly for Hyperscale edition
LicenseTypeStringYesBasePrice
LicenseIncluded (D)
ZoneRedundantBoolean

Backup

AttributeTypeMandatoryValuesDefaultNotes
StorageRedundancyStringNoLocal (D), Zone, Geo, GeoZone
RetentionDaysNumberNo7
DiffFrequencyNumberNo12, 24
LongTermRetentionObjectNo

Backup LongTermRetention

AttributeTypeMandatoryValuesDefaultNotes
WeeklyNumber
MonthlyNumber
YearlyNumber
YearlyWeekRetainerNumber

Autotuning

AttributeTypeMandatoryValuesDefaultNotes
InheritFromStringNoServer, AzureDefaults, DontInheritServer
CreateIndexStringNoOn, Off, Inherit** Server(Inherit), AzureDefaults(Inherit), DontInherit(Off)
DropIndexStringNoOn, Off, Inherit** Server(Inherit), AzureDefaults(Inherit), DontInherit(Off)
ForcePlanStringNoOn, Off, Inherit** Server(Inherit), AzureDefaults(Inherit), DontInherit(On)

Diagnostic

AttributeTypeMandatoryValuesDefaultNotes
NameStringYes
LogObjectNo
MetricObjectNo
TargetObjectNo

Diagnostic Log

AttributeTypeMandatoryValuesDefaultNotes
EnabledBooleanNo* Defaults to true if Category is not null
CategoryArrayNoAutomaticTuningAll
Blocks
Deadlocks
Errors
DatabaseWaitStatistics
QueryStoreRuntimeStatistics
QueryStoreWaitStatistics
SQLInsightsEnable SQL Intelligent Insights
Timeouts

Diagnostic Metric

AttributeTypeMandatoryValuesDefaultNotes
EnabledBooleanNo* Defaults to true if Category is not null
CategoryArrayNoBasicAll
InstanceAndAppAdvanced
WorkloadManagement

Audit

AttributeTypeMandatoryValuesDefaultNotes
PredicateExpressionStringNo
RetentionInDaysNumberNo
ActionGroupArrayNo
TargetObjectNo

Audit Target

AttributeTypeMandatoryValuesDefaultNotes
BlobObjectNo
EventHubObjectNo
LogAnalyticsObjectNo
Audit Target Blob
AttributeTypeMandatoryValuesDefaultNotes
StorageAccountStringYes
ResourceGroupNameStringNoDefaults to RG of resource
SubscriptionNameStringNoDefaults to Sub of resource
StorageKeyTypeStringYesPrimary, Secondary
Audit Target EventHub
AttributeTypeMandatoryValuesDefaultNotes
NameStringYes
NamespaceStringYes
ResourceGroupNameStringNoDefaults to RG of resource
SubscriptionNameStringNoDefaults to Sub of resource
SharedAccessPolicyStringDefaults to RootManageSharedAccessKey
Audit Target LogAnalytics
AttributeTypeMandatoryValuesDefaultNotes
WorkspaceStringYes
ResourceGroupNameStringNoDefaults to RG of resource
SubscriptionNameStringNoDefaults to Sub of resource

Replica

AttributeTypeMandatoryValuesDefaultNotes
NameString
ServerNameString
ResourceGroupNameString
VCoreNumber
LicenseTypeStringBase,Base allows for Azure Hybrid Benefit
LicenseIncluded (D)Base allows for Azure Hybrid Benefit
AllowConnectionsStringNone, AllAll
HighAvailabilityReplicaCountNumberOnly for Hyperscale edition
BackupStorageRedundancyStringLocal (D), Zone, Geo, GeoZone
ZoneRedundantBooleanTrue, False (D)Only settable for Hyperscale edition
ElasticPoolNameString
ComputeGenerationStringGen5 (D), FSv2, DC, M
TagObject

Input by YAML

Object model for YAML deployment:

---
azSqlDatabase:
# Mandatory
- Name: 'string'
ResourceGroupName: 'string'
ServerName: 'string'

# Specify pool name
ElasticPoolName: 'string'

# If no pool name specified
DtuModel:
Edition: 'string' # Basic, Standard, Premium
Dtu: number # Defaults Basic(5), Standard(100), Premium(125)
VCoreModel:
Edition: 'string' # GeneralPurpose, BusinessCritical, Hyperscale
VCore: number
ComputeGeneration: 'string' # Gen5 (D), FSv2, DC, M
HighAvailabilityReplicaCount: number # Only for Hyperscale edition
LicenseType: 'string' # BasePrice, LicenseIncluded
ZoneRedundant: boolean # True, False (D)

Backup:
StorageRedundancy: 'string' # Local (D), Zone, Geo, GeoZone
RetentionDays: number # Basic, Fixed 7 days, Standard upwards 1-35 days, (7)
DiffFrequency: number # 12, 24 (D)
LongTermRetention:
Weekly: 'string' # ISO 8601 format duration, e.g. P10D, P2W, P3Y
Monthly: 'string' # ISO 8601 format duration, e.g. P10D, P2W, P3Y
Yearly: 'string' # ISO 8601 format duration, e.g. P10D, P2W, P3Y
YearlyWeekRetainer: number # week number to retain from the yearly

Autotuning:
InheritFrom: 'string' # DontInherit (D), AzureDefaults, Server
CreateIndex: 'string' # On, Off, Inherit, Defaults DontInherit(Off), AzureDefaults(Inherit), Server(Inherit)
DropIndex: 'string' # On, Off, Inherit, Defaults DontInherit(Off), AzureDefaults(Inherit), Server(Inherit)
ForcePlan: 'string' # On, On, Inherit, Defaults DontInherit(Off), AzureDefaults(Inherit), Server(Inherit)

# Optional
CollationName: 'string'
CatalogCollation: 'string'
ReadScale: 'string' # Enabled, Disabled (Only for Premium, Business Critical)
ComputeModel: 'string' # Provisioned (D), Serverless
AutoPauseDelayInMinutes: number # Only for Serverless, -1 to opt out
MinimumCapacity: 'string' # Only for Serverless
EnableLedger: boolean # True, False (D)
MaxSizeBytes: number
SecondaryType: 'string' # Geo, Named
FailoverGroup: 'string' # SQL Database Failover Group

Replica:
- Name: # Replica db name can be different to the primary db name, defaults to primary
ServerName: 'string'
ResourceGroupName: 'string' # Defaults to RG of primary
VCore: number
LicenseType: 'string' # Base, LicenseIncluded (D)
AllowConnections: 'string' # None, All (D)
HighAvailabilityReplicaCount: number # Only for Hyperscale edition
BackupStorageRedundancy: 'string' # Local (D), Zone, Geo, GeoZone
ZoneRedundant: boolean # True, False (D), only settable for Hyperscale edition
ElasticPoolName: 'string'
ComputeGeneration: 'string' # Gen5 (D), FSv2, DC, M
Tag:
'keyvalue-pairs'

Tag:
'keyvalue-pairs'

Lock:
- Name: 'string'
Level: 'string' # CanNotDelete, ReadOnly
Notes: 'string'

Diagnostic:
- Name: 'string'
Log:
Enabled: boolean # True (D if Category not null), False
Category: [array] # Defaults to all if enabled
Metric:
Enabled: boolean # True (D if MetricCategory not null), False
Category: [array] # Defaults to all if enabled
Target:
Blob:
StorageAccount: 'string'
StorageKeyType: 'string' # Primary, Secondary
RetentionInDays: number
ResourceGroupName: 'string' # Defaults to RG of resource
SubscriptionName: 'string' # Defaults to subscription of resource
EventHub:
Name: 'string'
Namespace: 'string'
SharedAccessPolicy: 'string' # RootManageSharedAccessKey (D)
ResourceGroupName: 'string' # Defaults to RG of resource
SubscriptionName: 'string' # Defaults to subscription of resource
LogAnalytics:
Workspace: 'string'
ResourceGroupName: 'string' # Defaults to RG of resource
SubscriptionName: 'string' # Defaults to subscription of resource

Input by JSON

Object model for JSON deployment:

{
"azSqlDatabase": [
{
"Name": "string",
"ResourceGroupName": "string",
"ServerName": "string",
"ElasticPoolName": "string",
"DtuModel": {
"Edition": "string",
"Dtu": number
},
"VCoreModel": {
"Edition": "string",
"VCore": number,
"ComputeGeneration": "string",
"HighAvailabilityReplicaCount": number,
"LicenseType": "string"
},
"ZoneRedundant": boolean,
"Backup": {
"StorageRedundancy": "string",
"RetentionDays": number,
"DiffFrequency": number,
"LongTermRetention": {
"Weekly": number,
"Monthly": number,
"Yearly": number,
"YearlyWeekRetainer": number
}
},
"Autotuning": {
"InheritFrom": "string",
"CreateIndex": "string",
"DropIndex": "string",
"ForcePlan": "string"
},
"CollationName": "string",
"CatalogCollation": "string",
"ReadScale": "string",
"ComputeModel": "string",
"AutoPauseDelayInMinutes": number,
"MinimumCapacity": "string",
"BackupStorageRedundancy": "string",
"EnableLedger": boolean,
"MaxSizeBytes": number,
"SecondaryType": "string",
"Replica": [
{
"Name": "string",
"ServerName": "string",
"ResourceGroupName": "string",
"VCore": number,
"LicenseType": "string",
"AllowConnections": "string",
"HighAvailabilityReplicaCount": number,
"BackupStorageRedundancy": "string",
"ZoneRedundant": boolean,
"ElasticPoolName": "string",
"ComputeGeneration": "string",
"ServerName": "string",
"Tag": {
"key": "value"
},
}
],
"Tag": {
"key": "string"
},
"Lock": [
{
"Name": "string",
"Level": "string",
"Notes": "string"
}
],
"Diagnostic": [
{
"Name": "string",
"Log": {
"Enabled": boolean,
"Category": [array]
},
"Metric": {
"Enabled": boolean,
"Category": [array]
},
"Target": {
"Blob": {
"StorageAccount": "string",
"StorageKeyType": "string",
"RetentionInDays": number,
"ResourceGroupName": "string",
"SubscriptionName": "string"
},
"EventHub": {
"Name": "string",
"Namespace": "string",
"SharedAccessPolicy": "string",
"ResourceGroupName": "string",
"SubscriptionName": "string"
},
"LogAnalytics": {
"Workspace": "string",
"ResourceGroupName": "string",
"SubscriptionName": "string"
}
}
}
]
}
]
}