This module deploys an Azure SQL Server Database.
| Resource Type | API Version |
|---|---|
Microsoft.Insights/diagnosticSettings |
2021-05-01-preview |
Microsoft.Sql/servers/databases |
2022-05-01-preview |
Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies |
2022-05-01-preview |
Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies |
2022-05-01-preview |
Required parameters
| Parameter | Type | Description |
|---|---|---|
name |
string | The name of the database. |
Conditional parameters
| Parameter | Type | Description |
|---|---|---|
serverName |
string | The name of the parent SQL Server. Required if the template is used in a standalone deployment. |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
autoPauseDelay |
int | Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled. |
backupLongTermRetentionPolicy |
object | The long term backup retention policy to create for the database. |
backupShortTermRetentionPolicy |
object | The short term backup retention policy to create for the database. |
collation |
string | The collation of the database. |
createMode |
string | Specifies the mode of database creation. |
diagnosticSettings |
array | The diagnostic settings of the service. |
elasticPoolId |
string | The resource ID of the elastic pool containing this database. |
enableDefaultTelemetry |
bool | Enable telemetry via a Globally Unique Identifier (GUID). |
highAvailabilityReplicaCount |
int | The number of readonly secondary replicas associated with the database. |
isLedgerOn |
bool | Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created. |
licenseType |
string | The license type to apply for this database. |
location |
string | Location for all resources. |
maintenanceConfigurationId |
string | Maintenance configuration ID assigned to the database. This configuration defines the period when the maintenance updates will occur. |
maxSizeBytes |
int | The max size of the database expressed in bytes. |
minCapacity |
string | Minimal capacity that database will always have allocated. |
preferredEnclaveType |
string | Type of enclave requested on the database i.e. Default or VBS enclaves. |
readScale |
string | The state of read-only routing. |
recoveryServicesRecoveryPointResourceId |
string | Resource ID of backup if createMode set to RestoreLongTermRetentionBackup. |
requestedBackupStorageRedundancy |
string | The storage account type to be used to store backups for this database. |
restorePointInTime |
string | Point in time (ISO8601 format) of the source database to restore when createMode set to Restore or PointInTimeRestore. |
sampleName |
string | The name of the sample schema to apply when creating this database. |
skuCapacity |
int | Capacity of the particular SKU. |
skuFamily |
string | If the service has different generations of hardware, for the same SKU, then that can be captured here. |
skuName |
string | The name of the SKU. |
skuSize |
string | Size of the particular SKU. |
skuTier |
string | The skuTier or edition of the particular SKU. |
sourceDatabaseDeletionDate |
string | The time that the database was deleted when restoring a deleted database. |
sourceDatabaseResourceId |
string | Resource ID of database if createMode set to Copy, Secondary, PointInTimeRestore, Recovery or Restore. |
tags |
object | Tags of the resource. |
zoneRedundant |
bool | Whether or not this database is zone redundant. |
The name of the database.
- Required: Yes
- Type: string
The name of the parent SQL Server. Required if the template is used in a standalone deployment.
- Required: Yes
- Type: string
Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled.
- Required: No
- Type: int
- Default:
0
The long term backup retention policy to create for the database.
- Required: No
- Type: object
- Default:
{}
The short term backup retention policy to create for the database.
- Required: No
- Type: object
- Default:
{}
The collation of the database.
- Required: No
- Type: string
- Default:
'SQL_Latin1_General_CP1_CI_AS'
Specifies the mode of database creation.
- Required: No
- Type: string
- Default:
'Default' - Allowed:
[ 'Copy' 'Default' 'OnlineSecondary' 'PointInTimeRestore' 'Recovery' 'Restore' 'RestoreLongTermRetentionBackup' 'Secondary' ]
The diagnostic settings of the service.
- Required: No
- Type: array
Optional parameters
| Parameter | Type | Description |
|---|---|---|
eventHubAuthorizationRuleResourceId |
string | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. |
eventHubName |
string | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
logAnalyticsDestinationType |
string | A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type. |
logCategoriesAndGroups |
array | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
marketplacePartnerResourceId |
string | The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. |
metricCategories |
array | The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection. |
name |
string | The name of diagnostic setting. |
storageAccountResourceId |
string | Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
workspaceResourceId |
string | Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. |
Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to.
- Required: No
- Type: string
Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.
- Required: No
- Type: string
A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type.
- Required: No
- Type: string
- Allowed:
[ 'AzureDiagnostics' 'Dedicated' ]
The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection.
- Required: No
- Type: array
The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.
- Required: No
- Type: string
The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to '' to disable log collection.
- Required: No
- Type: array
The name of diagnostic setting.
- Required: No
- Type: string
Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.
- Required: No
- Type: string
Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.
- Required: No
- Type: string
The resource ID of the elastic pool containing this database.
- Required: No
- Type: string
- Default:
''
Enable telemetry via a Globally Unique Identifier (GUID).
- Required: No
- Type: bool
- Default:
True
The number of readonly secondary replicas associated with the database.
- Required: No
- Type: int
- Default:
0
Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created.
- Required: No
- Type: bool
- Default:
False
The license type to apply for this database.
- Required: No
- Type: string
- Default:
''
Location for all resources.
- Required: No
- Type: string
- Default:
[resourceGroup().location]
Maintenance configuration ID assigned to the database. This configuration defines the period when the maintenance updates will occur.
- Required: No
- Type: string
- Default:
''
The max size of the database expressed in bytes.
- Required: No
- Type: int
- Default:
34359738368
Minimal capacity that database will always have allocated.
- Required: No
- Type: string
- Default:
''
Type of enclave requested on the database i.e. Default or VBS enclaves.
- Required: No
- Type: string
- Default:
'' - Allowed:
[ '' 'Default' 'VBS' ]
The state of read-only routing.
- Required: No
- Type: string
- Default:
'Disabled' - Allowed:
[ 'Disabled' 'Enabled' ]
Resource ID of backup if createMode set to RestoreLongTermRetentionBackup.
- Required: No
- Type: string
- Default:
''
The storage account type to be used to store backups for this database.
- Required: No
- Type: string
- Default:
'' - Allowed:
[ '' 'Geo' 'Local' 'Zone' ]
Point in time (ISO8601 format) of the source database to restore when createMode set to Restore or PointInTimeRestore.
- Required: No
- Type: string
- Default:
''
The name of the sample schema to apply when creating this database.
- Required: No
- Type: string
- Default:
''
Capacity of the particular SKU.
- Required: No
- Type: int
- Default:
-1
If the service has different generations of hardware, for the same SKU, then that can be captured here.
- Required: No
- Type: string
- Default:
''
The name of the SKU.
- Required: No
- Type: string
- Default:
'GP_Gen5_2'
Size of the particular SKU.
- Required: No
- Type: string
- Default:
''
The skuTier or edition of the particular SKU.
- Required: No
- Type: string
- Default:
'GeneralPurpose'
The time that the database was deleted when restoring a deleted database.
- Required: No
- Type: string
- Default:
''
Resource ID of database if createMode set to Copy, Secondary, PointInTimeRestore, Recovery or Restore.
- Required: No
- Type: string
- Default:
''
Tags of the resource.
- Required: No
- Type: object
Whether or not this database is zone redundant.
- Required: No
- Type: bool
- Default:
False
| Output | Type | Description |
|---|---|---|
location |
string | The location the resource was deployed into. |
name |
string | The name of the deployed database. |
resourceGroupName |
string | The resource group of the deployed database. |
resourceId |
string | The resource ID of the deployed database. |
None