Microsoft.Sql servers/databases template reference

To create a Microsoft.Sql/servers/databases resource, add the following JSON to the resources section of your template.

{
  "name": "string",
  "type": "Microsoft.Sql/servers/databases",
  "apiVersion": "2017-10-01-preview",
  "location": "string",
  "tags": {},
  "sku": {
    "name": "string",
    "tier": "string",
    "size": "string",
    "family": "string",
    "capacity": "integer"
  },
  "properties": {
    "createMode": "string",
    "collation": "string",
    "maxSizeBytes": "integer",
    "sampleName": "string",
    "elasticPoolId": "string",
    "sourceDatabaseId": "string",
    "restorePointInTime": "string",
    "sourceDatabaseDeletionDate": "string",
    "recoveryServicesRecoveryPointId": "string",
    "longTermRetentionBackupResourceId": "string",
    "recoverableDatabaseId": "string",
    "restorableDroppedDatabaseId": "string",
    "catalogCollation": "string",
    "zoneRedundant": boolean,
    "licenseType": "string",
    "readScale": "string"
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.Sql/servers/databases object

Name Type Required Value
name string Yes The name of the database.
type enum Yes Microsoft.Sql/servers/databases
apiVersion enum Yes 2017-10-01-preview
location string Yes Resource location.
tags object No Resource tags.
sku object No The name and tier of the SKU. - Sku object
properties object Yes Resource properties. - DatabaseProperties object

Sku object

Name Type Required Value
name string Yes The name of the SKU. Ex - P3. It is typically a letter+number code
tier string No This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.
size string No The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code.
family string No If the service has different generations of hardware, for the same SKU, then that can be captured here.
capacity integer No If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.

DatabaseProperties object

Name Type Required Value
createMode enum No Specifies the mode of database creation.
Default: regular database creation.
Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - Default, Copy, Secondary, PointInTimeRestore, Restore, Recovery, RestoreExternalBackup, RestoreExternalBackupSecondary, RestoreLongTermRetentionBackup, OnlineSecondary
collation string No The collation of the database.
maxSizeBytes integer No The max size of the database expressed in bytes.
sampleName enum No The name of the sample schema to apply when creating this database. - AdventureWorksLT, WideWorldImportersStd, WideWorldImportersFull
elasticPoolId string No The resource identifier of the elastic pool containing this database.
sourceDatabaseId string No The resource identifier of the source database associated with create operation of this database.
restorePointInTime string No Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
sourceDatabaseDeletionDate string No Specifies the time that the database was deleted.
recoveryServicesRecoveryPointId string No The resource identifier of the recovery point associated with create operation of this database.
longTermRetentionBackupResourceId string No The resource identifier of the long term retention backup associated with create operation of this database.
recoverableDatabaseId string No The resource identifier of the recoverable database associated with create operation of this database.
restorableDroppedDatabaseId string No The resource identifier of the restorable dropped database associated with create operation of this database.
catalogCollation enum No Collation of the metadata catalog. - DATABASE_DEFAULT or SQL_Latin1_General_CP1_CI_AS
zoneRedundant boolean No Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
licenseType enum No The license type to apply for this database. - LicenseIncluded or BasePrice
readScale enum No The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. - Enabled or Disabled