Databases - Create Or Update

Creates a new database or updates an existing database.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}?api-version=2021-11-01

URI Parameters

Name In Required Type Description
databaseName
path True

string

The name of the database.

resourceGroupName
path True

string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

serverName
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Request Body

Name Required Type Description
location True

string

Resource location.

identity

DatabaseIdentity

The Azure Active Directory identity of the database.

properties.autoPauseDelay

integer

Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled

properties.catalogCollation

CatalogCollationType

Collation of the metadata catalog.

properties.collation

string

The collation of the database.

properties.createMode

CreateMode

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.

properties.elasticPoolId

string

The resource identifier of the elastic pool containing this database.

properties.federatedClientId

string

The Client id used for cross tenant per database CMK scenario

properties.highAvailabilityReplicaCount

integer

The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool.

properties.isLedgerOn

boolean

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.

properties.licenseType

DatabaseLicenseType

The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.

properties.longTermRetentionBackupResourceId

string

The resource identifier of the long term retention backup associated with create operation of this database.

properties.maintenanceConfigurationId

string

Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.

properties.maxSizeBytes

integer

The max size of the database expressed in bytes.

properties.minCapacity

number

Minimal capacity that database will always have allocated, if not paused

properties.readScale

DatabaseReadScale

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. Not applicable to a Hyperscale database within an elastic pool.

properties.recoverableDatabaseId

string

The resource identifier of the recoverable database associated with create operation of this database.

properties.recoveryServicesRecoveryPointId

string

The resource identifier of the recovery point associated with create operation of this database.

properties.requestedBackupStorageRedundancy

BackupStorageRedundancy

The storage account type to be used to store backups for this database.

properties.restorableDroppedDatabaseId

string

The resource identifier of the restorable dropped database associated with create operation of this database.

properties.restorePointInTime

string

Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.

properties.sampleName

SampleName

The name of the sample schema to apply when creating this database.

properties.secondaryType

SecondaryType

The secondary type of the database if it is a secondary. Valid values are Geo and Named.

properties.sourceDatabaseDeletionDate

string

Specifies the time that the database was deleted.

properties.sourceDatabaseId

string

The resource identifier of the source database associated with create operation of this database.

properties.sourceResourceId

string

The resource identifier of the source associated with the create operation of this database.

This property is only supported for DataWarehouse edition and allows to restore across subscriptions.

When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover.

When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing database or existing sql pool, and restorePointInTime must be specified.

When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped sql pool.

When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool.

When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. For more details about “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant

properties.zoneRedundant

boolean

Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.

sku

Sku

The database SKU.

The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the Capabilities_ListByLocation REST API or one of the following commands:

az sql db list-editions -l <location> -o table
Get-AzSqlServerServiceObjective -Location <location>
tags

object

Resource tags.

Responses

Name Type Description
200 OK

Database

Successfully updated the database.

201 Created

Database

Successfully created the database.

202 Accepted

Creating or updating the database is in progress.

Other Status Codes

*** Error Responses: ***

  • 400 InvalidDatabaseCreateOrUpdateRequest - The request body for the create or update database operation is invalid.

  • 400 InvalidResourceId - Invalid resource identifier.

  • 400 InvalidSourceDatabaseId - Invalid source database identifier.

  • 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.

  • 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.

  • 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

  • 400 MissingCollation - Collation is required.

  • 400 MissingMaxSizeBytes - MaxSizeBytes is required.

  • 400 MissingSkuName - Sku name is required.

  • 400 MissingSourceDatabaseId - Missing source database identifier.

  • 400 InvalidLicenseType - The specified license type is invalid.

  • 400 InvalidSkuName - Invalid SKU name.

  • 400 MismatchedSkuNameAndCapacity - Mismatch between SKU name and capacity.

  • 400 MismatchedSkuNameAndTier - Mismatch between SKU name and tier.

  • 400 MismatchedSkuNameAndFamily - Mismatch between SKU name and family.

  • 400 LedgerNotAllowedWithSpecifiedCreateMode - IsLedgerOn is not allowed with the specified create mode.

  • 400 LedgerNotAllowedOnSampleDatabase - Database creation is not allowed with IsLedgerOn for a sample database.

  • 400 DatabaseNameDoesNotMatchSourceDatabaseId - The database name specified doesn’t match the database name in sourceDatabaseId.

  • 400 ElasticPoolNotSupportedForExternalBackupRestore - Elastic pool is not supported for external backup restore

  • 400 InvalidRecoverableDatabaseId - Invalid recoverable database identifier.

  • 400 InvalidRecoveryServicesRecoveryPointId - Invalid recovery services recovery point identifier.

  • 400 InvalidRestorableDroppedDatabaseDeletionDate - The restorable dropped database deletion date given is invalid

  • 400 InvalidRestorableDroppedDatabaseId - Invalid restorable dropped database identifier

  • 400 MissingRecoverableDatabaseId - Missing recoverable database identifier.

  • 400 MissingRecoveryServicesRecoveryPointId - Missing recovery services recovery point Id.

  • 400 MissingRestorableDroppedDatabaseId - Missing restorableDroppedDatabaseId

  • 400 MissingRestorePointInTime - Missing restore point in time

  • 400 MissingSourceDatabaseDeletionDate - Missing source database deletion date

  • 400 MissingStorageContainerSasToken - Missing storage container SAS token

  • 400 MissingStorageContainerUri - Missing storage container URI

  • 400 RestorableDroppedDatabaseIdGivenForRestoreWithSourceDatabaseId - Cannot specify restorableDroppedDatabaseId when sourceDatabaseId is already given in restore create mode

  • 400 MultipleIdentitiesOnDatabase - Only one user assigned managed identity is supported at the Database Level.

  • 400 MultipleIdentityDelegationsOnDatabase - Only one identity delegation is supported at the Database Level.

  • 400 MissingPrimaryDelegatedIdentityClientId - In order to use delegated identities please provide a primary delegated identity client id.

  • 400 InvalidStandbyGeoReadScale - User attempted to enable read scale on a standby geo database that does not support it.

  • 400 PerDatabaseCMKKeyRotationAttemptedWhileOldThumbprintInUse - Key Rotation for the TDE Protector at the database level is blocked when active transactions are holding up the log encrypted with old keys. Please refer to aka.ms/azuresqldbkeyrotation for possible strategies to workaround this issue.

  • 400 TierChangeUnsupportedDueToMemoryOptimizedObject - The database cannot update its sku because it has memory-optimized objects.

  • 400 PerDBCMKNotSupportedWithLTR - Database-level CMK is not supported when Long-term Backup Retention is enabled on the database.

  • 400 SourceServerNotFound - The server part of a source database id provided in a CreateDatabaseAsCopy API call doesn't map to an existing server.

  • 400 ElasticPoolOverStorageUsage - Attempting to write data to a database when the storage limit of the elastic pool has been reached.

  • 400 InvalidDatabaseCreateMode - Invalid request to create a database.

  • 400 MissingAsymmetricKeyOnTargetServer - Target server does not have access to an asymmetric key.

  • 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.

  • 400 MultipleDroppedDatabasesWithTheSameName - Found multiple dropped databases with the same name on server.

  • 400 InvalidAddSecondaryPermission - User does not have sufficient permission to add secondary on the specified server.

  • 400 AzureKeyVaultClientError - The Azure Key Vault client encountered an error.

  • 400 UnsupportedServiceName - The specified name is an invalid name because it contains one or more unsupported unicode characters.

  • 400 AzureKeyVaultClientInfoError - An error occurred while obtaining information for the Azure Key Vault client.

  • 400 CurrentDatabaseLogSizeExceedsMaxSize - User attempted to change the database to a sku with lower max log size than the current usage.

  • 400 IsLedgerDatabaseIsNotSupportedOnResourceType - Changing the ledger property is not supported for this resource type.

  • 400 InvalidBackupStorageAccountType - User passed zrs/lrs during create/update of a database but it failed either because the customer is not whitelisted or because zrs is not available in the specified region.

  • 400 CannotUpdateToFreeDatabase - Updating a database to the free sku is not supported.

  • 400 DatabaseInvalidSkuPropertyCombination - The properties of the requested sku are inconsistent. Please check that a valid combination is specified. See https://docs.microsoft.com/en-us/rest/api/sql/capabilities/listbylocation#serviceobjectivecapability for more details.

  • 400 DatabaseNamedReplicaPerDatabaseLimitExceeded - User tried create a named replica that would exceed the allowed number per primary database

  • 400 UnsupportedBackupStorageRedundancyForEdition - The requested backup storage redundancy is not supported for edition

  • 400 DatabaseIsCurrentlyPinned - Microsoft has pinned your database SQL Server engine version. To ensure your database does not hit production issues, any future scale operations on your database will be blocked until it has been un-pinned. Please contact Microsoft support for assistance with scaling.

  • 400 RestoreTargetEditionSizeInsufficient - User attempted to restore a database to an edition that is a smaller size than the current allocated size of the source.

  • 400 InvalidSku - The user specified an invalid sku.

  • 400 InvalidTierSkuCombination - The specified tier does not support the specified sku.

  • 400 ServerNotFound - The requested server was not found.

  • 400 UnsupportedBackupStorageRedundancy - Specified Backup Storage Redundancy is not supported in target region.

  • 400 InvalidIdentityId - One or more identity id(s) provided are not valid ARM resource id(s). Please input valid id(s) and try again.

  • 400 LTRSterlingToVldbMigrationNotSupported - Cannot change service objective for database to Hyperscale as long-term retention is not yet supported on Hyperscale. Please disable long-term retention on the database and retry.

  • 400 TokenTooLong - The provided token is too long.

  • 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.

  • 400 OfferDisabledOnSubscription - Subscription offer type is restricted from provisioning the requested resource.

  • 400 UnableToCreateGeoChain - User attempted to create secondary database (chaining) even though automatic upload of ledger digests has been configured

  • 400 InvalidNumberOfIdentities - Only one user assigned managed identity is supported at the Database Level.

  • 400 DatabaseNamedReplicaChainingNotAllowed - User tried to create a named replica of a named replica which is not allowed.

  • 400 DatabaseNamedReplicaInvalidOperation - User attempted an unsupported operation on a named replica.

  • 400 DatabaseNamedReplicaInvalidSourceDatabase - User attempted to create a named replica in a different subscription or region than the source database.

  • 400 InvalidTargetSubregion - The target server of a non-readable secondary is not in a DR paired Azure region.

  • 400 CannotAssignIdentityToMaster - Cannot assign an identity to a system database. Database identity cannot be assigned to 'master', 'model', 'tempdb', 'msdb', or 'resource' databases.

  • 400 PerDatabaseCMKDWNotSupported - Database-level CMK in preview is not supported for Datawarehouse edition.

  • 400 DatabaseCreationBlockedForNonActivatedCMKServer - SQL Pool creations are blocked for CMK enabled workspaces until the workspace is activated. First, enable purge protection and grant the workspace Managed Identity the required permissions (Get, Wrap Key, Unwrap Key) on the Azure Key Vault of the workspace key. Next, activate your workspace after you have granted access.

  • 400 PartnerServerNotCompatible - The user is attempting to copy a database from a SAWA V1 server to a Sterling server or vice versa.

  • 400 IncorrectReplicationLinkState - The operation expects the database to be in an expected state on the replication link.

  • 400 TargetElasticPoolDoesNotExist - The elastic pool does not exist on a server.

  • 400 ElasticPoolSkuCombinationInvalid - Elastic pool and sku can be specified together only if sku is specified as 'ElasticPool'.

  • 400 ElasticPoolTierCombinationInvalid - The database tier is different than the elastic pool service tier.

  • 400 ElasticPoolNameRequired - User tried to create or update database to elastic pool service objective without specifying the name of the elastic pool.

  • 400 MissingThumbprintCrm - The restore operation of a CRM database failed because a required TDE certificate was missing. Please retry the restore operation to an existing elastic pool.

  • 400 ElasticPoolOverStorage - Attempting to write data to a database when the storage limit of the elastic pool has been reached.

  • 400 ElasticPoolInconsistentDtuGuaranteeSettings - Attempting to provide DTU min for databases in the elastic pool that exceeds requested DTUs of the elastic pool.

  • 400 RestoreTargetEditionSizeInsufficientV2 - User attempted to restore a database to an edition that is a smaller size than the allocated size of the restored database.

  • 400 TierChangeUnsupportedDueToCDCEnabledDatabase - The database cannot update its sku because it is enabled for CDC.

  • 400 ElasticPoolDatabaseCountOverLimit - Attempting to create or add database to elastic pool when the database count limit of the elastic pool has been reached.

  • 400 ResourcePoolStorageLimitHitDuringRestore - The restored database can't be restored into the resource pool due to the remaining storage capacity in the pool.

  • 400 CannotChangeToOrFromDataWarehouseTier - User attempted to change the sku of a database from DataWarehouse tier to non DataWarehouse tiers or vice versa.

  • 400 CurrentDatabaseSizeExceedsMaxSize - User attempted to reduce the max size for a database to a size smaller than the current usage.

  • 400 PerDatabaseCMKRestoreNotSupported - Database restore is not supported when Database-level CMK is configured in preview.

  • 400 PerDatabaseCMKHSNotSupported - Database-level CMK in preview is not supported for Hyperscale edition.

  • 400 AzureKeyVaultKeyDisabled - The operation could not be completed on the server because the Azure Key Vault key is disabled.

  • 400 PerDatabaseCMKGeoReplicationNotSupported - Geo Replication and Database Copy is not supported when Database-level CMK is configured in preview.

  • 400 ElasticPoolDecreaseStorageLimitBelowUsage - Attempting to decrease the storage limit of the elastic pool below its storage usage.

  • 400 AzureKeyVaultInvalidExpirationDate - The operation could not be completed because the Azure Key Vault key expiration date is invalid.

  • 400 InvalidStandbyGeoEdition - User attempted to create a DTU based standby geo.

  • 400 SecurityAzureKeyVaultUrlNullOrEmpty - The operation could not be completed because the Azure Key Vault Uri is null or empty.

  • 400 ElasticPoolInconsistentVcoreGuaranteeSettings - The number of databases and VCore min per database cannot exceed requested VCores of the elastic pool.

  • 400 UpdateNotAllowedOnPausedDatabase - User attempted to perform an update on a paused database.

  • 400 GeoRestoreBackupStorageTypeNotSupported - Database recovery requests are invalid when issued against a database that is not configured to use geo-redundant backup storage.

  • 400 RestoreHyperscaleToNonHyperscale - Restoring a Hyperscale database backup to a non-Hyperscale service tier or vice versa is not supported.

  • 400 SubscriptionDoesNotHaveAccessToServer - The subscription does not have access to the specified server(s)

  • 400 RecoveryPointDoesNotExist - The specified recovery point either does not exist or is not valid.

  • 400 AzureKeyVaultNoServerIdentity - The server identity is not correctly configured.

  • 400 InvalidMaxSizeTierCombination - The specified tier does not support the specified database max size.

  • 400 LtrBackupNotFound - The specified long term retention backup does not exist.

  • 400 AzureKeyVaultInvalidUri - An invalid response from Azure Key Vault. Please use a valid Azure Key Vault URI.

  • 400 InvalidPointInTime - The specified point in time is not valid for the database.

  • 400 AzureKeyVaultMissingPermissions - The server is missing required permissions on the Azure Key Vault.

  • 400 GeoRestoreCannotResolveTargetCluster - Cannot resolve target cluster for server

  • 400 InvalidReadScaleEdition - User attempted to enable read scale on a database type that does not support it.

  • 400 CannotSpecifyEditionOrSloWhenRestoringToPool - Specifying the target service level objective or edition is not supported when restoring to an elastic pool.

  • 400 InvalidReadScaleUnits - User attempted to provide a read scale value that is not supported.

  • 400 RestoreNotSupportedForGeoDrSecondary - Point-in-time restore and database recovery operations are not supported on databases that are currently configured as geo-secondaries.

  • 400 SecurityAzureKeyVaultInvalidKeyName - The operation could not be completed because of an invalid Server Key name.

  • 400 RegionDoesNotSupportVersion - A user attempted to create a server of a specified version in a location where that server version isn't supported.

  • 400 GeoSecondaryMaxSizeUpdateFailed - The geo-secondary database is of a SLO that does not support the requested maxsize value or the geo-secondary is in an unsupported region or an update operation is already in progress on the geo-secondary database.

  • 400 AdalGenericError - The operation could not be completed because an Azure Active Directory error was encountered.

  • 400 AdalServicePrincipalNotFound - The operation could not be completed because an Azure Active Directory library Service Principal not found error was encountered.

  • 400 InvalidTier - The user specified an invalid tier.

  • 400 AzureKeyVaultMalformedVaultUri - The provided Key Vault uri is not valid.

  • 400 CannotUseReservedDatabaseName - Cannot use reserved database name in this operation.

  • 400 RequestedDatabaseSizeRequiresShrink - User attempted to ALTER DATABASE MODIFY MAXSIZE to modify the MAXSIZE for a database to a smaller size then the current size.

  • 400 CurrentDatabaseSizeExceedsDbMaxSize - User attempted to reduce the max size for a database to a size smaller than the current usage.

  • 400 InvalidServerName - Invalid server name specified.

  • 400 CannotUseTrailingWhitespacesInDatabaseName - The database name validation failed.

  • 400 SourceDatabaseEditionCouldNotBeUpgraded - The source database cannot have higher edition than the target database.

  • 400 SecurityAdalPrincipalCertExpiredError - The operation could not be completed because the Azure Key Vault principal certificate has expired.

  • 400 TargetDatabaseEditionCouldNotBeDowngraded - The target database cannot have lower edition than the source database.

  • 400 UpdateNotAllowedIfGeoDrOperationInProgress - The operation is disallowed because copy or failover operation for database '{0}' on server '{1}' is currently in progress.

  • 400 InvalidCollation - Collation is not recognized by the server.

  • 400 SecurityInvalidAzureKeyVaultRecoveryLevel - The provided Key Vault uri is not valid.

  • 400 KeyMaterialNotFoundOnRemoteServer - Remote server does not have access to key material used as a TDE protector.

  • 400 AzureKeyVaultRsaKeyNotSupported - The provided key vault uses unsupported RSA Key Size or Key Type. The supported RSA key size is 2048 or 3072 and Key Type is RSA or RSA-HSM.

  • 400 SameKeyMaterialNotFoundOnRemoteServer - Secondary server does not have the key material of the primary server's encryption protector.

  • 400 ElasticPoolOverFileSpace - Insufficient file space in the elastic pool.

  • 400 PartnerDBNotCompatibleForSGXEnclave - Attempt to set GeoDR link or update SLO for enclave enabled database is only supported when both database are running on DC-series hardware.

  • 400 UpdateNotAllowedInCurrentReplicationState - The operation is disallowed on the database in its current replication state.

  • 400 InvalidLicenseType - User tried to create or update a database or elastic pool with unsupported license type.

  • 400 GeoReplicaLimitReached - The per-replica replication limit was reached.

  • 400 UnsupportedCapacity - User tried to create or update database with capacity which is not supported.

  • 400 ReplicationSourceAndTargetMustHaveSameName - The replication source and target databases must have the same name.

  • 400 ProvisioningDisabled - Displays error message from resources operation authorizer as is, without changes

  • 400 ReplicationSourceAndTargetMustBeInDifferentServers - The replication source and target databases must be in different logical servers.

  • 400 CannotUpdateIsLedgerDatabase - The ledger property of an existing database cannot be updated.

  • 400 UnableToResolveRemoteServer - The remote partner server name could not be resolved due to an invalid server name or DNS connectivity issues.

  • 400 RemoteDatabaseCopyPermission - User does not have sufficient permission to create a database copy on the specified server.

  • 400 CannotMoveOrDropSyncMetadataDatabase - Cannot drop database used as sync metadata database.

  • 400 SecurityAzureKeyVaultGeoChainError - Creating secondary of secondary (a process known as chaining) is not supported when enabling Transparent Data Encryption using Azure Key Vault (BYOK).

  • 400 RestoreToFreeEditionNotSupported - Restore and GeoRestore target cannot be free database.

  • 400 CannotMoveOrDropJobAccountDatabase - Cannot drop database associated with job account.

  • 400 RestoreNotSupportedForFreeEdition - Restore and GeoRestore are not supported for free database.

  • 400 JobAgentDatabaseEditionUnsupported - The specified database's service level objective is not supported for use as a job agent database.

  • 400 InvalidDroppedDatabase - Source database dropped does not exist on server within the supported recovery period.

  • 400 InvalidLiveDatabase - Source database does not exist on server within the supported recovery period. If restoring a dropped database, please specify its deletion date.

  • 400 InvalidVldbRecoverySlo - The Hyperscale edition recovery requires both source and target databases to use Hyperscale service level objective.

  • 400 SourceDatabaseNotFound - The source database does not exist.

  • 400 InvalidVldbRestoreSlo - The Hyperscale edition Point-In-Time restore requires both source and target databases to use Hyperscale service level objective.

  • 400 CannotSpecifyPoolOrSlo - Specifying an elastic pool and/or changing the service level objective or edition is not supported for edition.

  • 400 InvalidPublicMaintenanceConfiguration - User tried to specify public maintenance configuration which cannot be converted to internal id (malformed or wrong region).

  • 400 MaintenanceWindowNotSupportedForNamedReplica - User tried to create or update named replica with non-default maintenance window which is not supported.

  • 400 ChangeUnsupportedOnEntity - User attempted an unsupported create/update/delete operation on a given entity.

  • 400 LongTermRetentionMigrationRequestNotSupported - Subscription is not allowed LTR backup Migration feature.

  • 400 LongTermRetentionMigrationCrossClusterRequestNotSupported - Source and target subscriptions are not allowed to communicate for LTR backup copy feature.

  • 400 LongTermRetentionMigrationParameterMissing - Required parameter missing for the operation.

  • 400 LongTermRetentionMigrationSameServerNotSupported - LTR Copy feature is not supported to copy LTR backups within same server.

  • 400 LongTermRetentionMigrationTargetServerNotFound - Target server does not exists or is not ready for LTR backup copy operation.

  • 400 LongTermRetentionMigrationTargetDatabaseNotFound - Target Database does not exists on the server.

  • 400 LongTermRetentionMigrationStorageTypeNotSupported - Specified Backup Storage Redundancy is not supported in target region.

  • 400 LongTermRetentionMigrationStorageMismatch - Active backup redundancy of database does not match backup redundancy requested by customer.

  • 400 LongTermRetentionMigrationDatabaseTypeNotSupported - LTR migration is only supported for managed instance and Azure SQL DB LTR backups.

  • 400 LongTermRetentionMigrationBackupStorageRedundancyNotAllowed - Changing backup storage redundancy is not allowed for LTR Copy operations.

  • 400 LongTermRetentionMigrationSubscriptionNotFound - The subscription could not be found.

  • 404 OperationIdNotFound - The operation with Id does not exist.

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 SubscriptionNotFound - The requested subscription was not found.

  • 404 ServerNotInSubscription - Specified server does not exist on the specified subscription.

  • 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions

  • 404 LongTermRetentionMigrationBackupNotFound - LTR backup specified does not exists.

  • 405 UnsupportedReplicationOperation - An unsupported replication operation was initiated on the database.

  • 409 OperationCancelled - The operation has been cancelled by user.

  • 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

  • 409 FreeDbAlreadyExists - Only one free database can exist for a subscription per region.

  • 409 ConflictingServerOperation - An operation is currently in progress for the server.

  • 409 SubscriptionDisabled - Subscription is disabled.

  • 409 ConflictingSystemOperationInProgress - A system maintenance operation is in progress on the database and further operations need to wait until it is completed.

  • 409 ConflictRequestToUpdateBackupRedundancy - A conflict request to change backup storage redundancy is still in progress.

  • 409 SkuAssignmentInProgress - The current assignment request cannot be processed because a previous request has not completed.

  • 409 DatabaseElasticPoolMaintenanceConflict - User tried to create or update a database with a specified maintenance configuration that conflicted with that of the elastic pool of the database.

  • 409 ServerDtuQuotaExceeded - Could not perform the operation because server would exceed the allowed Database Throughput Unit quota.

  • 409 UnableToAlterDatabaseInReplication - User altered edition on a database in a replication relationship.

  • 409 SubscriptionVcoreQuotaExceeded - Could not perform the operation because subscription would exceed the allowed vCore quota.

  • 409 CurrentMemoryUsageExceedsSkuQuota - User attempted an sku update operation that cannot be completed due to the higher resource consumption.

  • 409 ServerKeyNameAlreadyExists - The server key already exists on the server.

  • 409 ServerKeyUriAlreadyExists - The server key URI already exists on the server.

  • 409 ServerKeyDoesNotExists - The server key does not exist.

  • 409 UpdateSloInProgress - User tried to initiate an incompatible operation while a SLO update was in progress.

  • 409 UpdateSloFailedDatabaseTooBusy - Update SLO operation could not complete because database was too busy.

  • 409 ElasticPoolBusy - A management operation was attempted on an elastic pool which is busy.

  • 409 AzureKeyVaultKeyNameNotFound - The operation could not be completed because the Azure Key Vault Key name does not exist.

  • 409 AzureKeyVaultKeyInUse - The key is currently being used by the server.

  • 409 ServerDisabled - Server is disabled.

  • 409 ConflictingDatabaseOperation - There is already some operation on the database and the current operation should wait till it is done.

  • 409 SimultaneousSkuChangeNotAllowed - Service objective change operations cannot run on both databases of a replication relationship at the same time.

  • 409 TargetElasticPoolBeingUpdated - The update of elastic pool cannot be started because there is copy operation in progress for one of the databases in this elastic pool

  • 409 InvalidOperationForDatabaseNotInReplicationRelationship - A replication seeding operation was performed on a database that is already in a replication relationship.

  • 409 InvalidOperationForDatabaseInReplicationRelationship - A replication seeding operation was performed on a database that is already in a replication relationship.

  • 409 DuplicateGeoDrRelation - The databases are already in a replication relation. This is a duplicate request.

  • 409 DatabaseCopyLimitPerReplicaReached - User reached the limit of concurrent database copies.

  • 409 RemoteDatabaseExists - The destination database name already exists on the destination server.

  • 409 LongTermRetentionMigrationRequestConflict - A conflict operation on this LTR backup is still in progress.

  • 409 LongTermRetentionMigrationBackupConflict - Another LTR backup with same backup time for target database exists.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.

  • 500 ActivateOrDeactivateWorkflowThrottling - Activation or deactivation workflow failed because there are too many concurrent workflows

  • 500 LongTermRetentionMigrationRequestFailedToStartOnTarget - Failed to start LTR backup copy request in target region.

  • 500 LongTermRetentionMigrationRequestCopyFailed - Copy operation failed for LTR backup blobs.

  • 500 LongTermRetentionMigrationRestoreVerExceeded - Restore verification failed after max attempts were reached.

  • 500 LongTermRetentionMigrationRestoreVerFailed - Restore verification failed.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 503 AzureKeyVaultConnectionFailed - The operation could not be completed on the server because attempts to connect to Azure Key Vault have failed

  • 503 AzureKeyVaultGenericConnectionError - The operation could not be completed because an error was encountered when attempting to retrieve Key Vault information .

  • 503 DatabaseUnavailable - The operation failed because the database is unavailable.

  • 504 RequestTimeout - Service request exceeded the allowed timeout.

Examples

Creates a data warehouse database as a cross-subscription restore from a backup of a dropped database.
Creates a data warehouse database as a cross-subscription restore from a geo-backup.
Creates a data warehouse database as a cross-subscription restore from a restore point of an existing database.
Creates a database as a copy.
Creates a database as an on-line secondary.
Creates a database as named replica secondary.
Creates a database from PointInTimeRestore.
Creates a database with default mode.
Creates a database with ledger on.
Creates a database with minimum number of parameters.
Creates a database with preferred maintenance window.
Creates a database with specified backup storage redundancy.
Creates a VCore database by specifying service objective name.
Creates a VCore database by specifying sku name and capacity.

Creates a data warehouse database as a cross-subscription restore from a backup of a dropped database.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw?api-version=2021-11-01

{
  "location": "southeastasia",
  "properties": {
    "createMode": "Restore",
    "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/restorableDroppedDatabases/srcdw,131403269876900000"
  }
}

Sample response

{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a data warehouse database as a cross-subscription restore from a geo-backup.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-WestUS/providers/Microsoft.Sql/servers/testsvr/databases/testdw?api-version=2021-11-01

{
  "location": "westus",
  "properties": {
    "createMode": "Recovery",
    "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-EastUS/providers/Microsoft.Sql/servers/srcsvr/recoverabledatabases/srcdw"
  }
}

Sample response

{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "westus",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-WestUS/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "westus",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-WestUS/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a data warehouse database as a cross-subscription restore from a restore point of an existing database.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw?api-version=2021-11-01

{
  "location": "southeastasia",
  "properties": {
    "createMode": "PointInTimeRestore",
    "sourceResourceId": "/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/srcsvr/databases/srcdw",
    "restorePointInTime": "2022-01-22T05:35:31.503Z"
  }
}

Sample response

{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "DataWarehouse",
    "tier": "DataWarehouse",
    "capacity": 9000
  },
  "kind": "v12.0,user,datawarehouse,gen2",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 263882790666240,
    "status": "Online",
    "databaseId": "188784c9-d602-4684-86cf-e67b6f03551a",
    "creationDate": "2022-01-24T06:46:14.99Z",
    "currentServiceObjectiveName": "DW1000c",
    "requestedServiceObjectiveName": "DW1000c",
    "defaultSecondaryLocation": "eastus",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "currentSku": {
      "name": "DataWarehouse",
      "tier": "DataWarehouse",
      "capacity": 9000
    },
    "currentBackupStorageRedundancy": "Geo"
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdw",
  "name": "testdw",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database as a copy.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbcopy?api-version=2021-11-01

{
  "location": "southeastasia",
  "sku": {
    "name": "S0",
    "tier": "Standard"
  },
  "properties": {
    "createMode": "Copy",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb"
  }
}

Sample response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbcopy",
  "name": "dbcopy",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbcopy",
  "name": "dbcopy",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database as an on-line secondary.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2021-11-01

{
  "location": "southeastasia",
  "sku": {
    "name": "S0",
    "tier": "Standard"
  },
  "properties": {
    "createMode": "Secondary",
    "secondaryType": "Geo",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/testdb"
  }
}

Sample response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "secondaryType": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "secondaryType": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database as named replica secondary.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2021-11-01

{
  "location": "southeastasia",
  "sku": {
    "name": "HS_Gen4",
    "tier": "Hyperscale",
    "capacity": 2
  },
  "properties": {
    "createMode": "Secondary",
    "secondaryType": "Named",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-NorthEurope/providers/Microsoft.Sql/servers/testsvr1/databases/primarydb"
  }
}

Sample response

{
  "sku": {
    "name": "HS_Gen4",
    "tier": "Hyperscale",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user,vcore,hyperscale",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": -1,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "HS_Gen4",
      "tier": "Hyperscale",
      "family": "Gen4",
      "capacity": 2
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "HS_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "HS_Gen4_2",
    "highAvailabilityReplicaCount": 0,
    "licenseType": "LicenseIncluded",
    "secondaryType": "Named",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "HS_Gen4",
    "tier": "Hyperscale",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user,vcore,hyperscale",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": -1,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "HS_Gen4",
      "tier": "Hyperscale",
      "family": "Gen4",
      "capacity": 2
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "HS_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "HS_Gen4_2",
    "highAvailabilityReplicaCount": 0,
    "licenseType": "LicenseIncluded",
    "secondaryType": "Named",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database from PointInTimeRestore.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr?api-version=2021-11-01

{
  "location": "southeastasia",
  "properties": {
    "createMode": "PointInTimeRestore",
    "sourceDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
    "restorePointInTime": "2020-10-22T05:35:31.503Z"
  }
}

Sample response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "2463ef48-53e2-4c26-9781-2d7138080bfd",
    "creationDate": "2020-10-23T20:31:35.807Z",
    "currentServiceObjectiveName": "S0",
    "requestedServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "SoutheastAsia",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "earliestRestoreDate": "2020-10-23T20:47:37Z",
    "readScale": "Disabled",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false
  },
  "location": "SoutheastAsia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr",
  "name": "dbpitr",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "2463ef48-53e2-4c26-9781-2d7138080bfd",
    "creationDate": "2020-10-23T20:31:35.807Z",
    "currentServiceObjectiveName": "S0",
    "requestedServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "SoutheastAsia",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "earliestRestoreDate": "2020-10-23T20:47:37Z",
    "readScale": "Disabled",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false
  },
  "location": "SoutheastAsia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SoutheastAsia/providers/Microsoft.Sql/servers/testsvr/databases/dbpitr",
  "name": "dbpitr",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with default mode.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2021-11-01

{
  "location": "southeastasia",
  "sku": {
    "name": "S0",
    "tier": "Standard"
  },
  "properties": {
    "createMode": "Default",
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824
  }
}

Sample response

{
  "sku": {
    "name": "S0",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "S0",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with ledger on.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2021-11-01

{
  "location": "southeastasia",
  "properties": {
    "isLedgerOn": true
  }
}

Sample response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "S0",
    "currentBackupStorageRedundancy": "Geo",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "zoneRedundant": false,
    "isLedgerOn": true
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Zone",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Zone",
    "requestedServiceObjectiveName": "S0",
    "zoneRedundant": false,
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with minimum number of parameters.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2021-11-01

{
  "location": "southeastasia"
}

Sample response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "S0",
    "currentBackupStorageRedundancy": "Geo",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Geo",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Geo",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with preferred maintenance window.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2021-11-01

{
  "location": "southeastasia",
  "sku": {
    "name": "S2",
    "tier": "Standard"
  },
  "properties": {
    "createMode": "Default",
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"
  }
}

Sample response

{
  "sku": {
    "name": "S2",
    "tier": "Standard"
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "S2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "earliestRestoreDate": "2020-08-29T06:41:18.283Z",
    "readScale": "Disabled",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 50
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1",
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "S2",
    "tier": "Standard"
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "S2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "earliestRestoreDate": "2020-08-29T06:41:18.283Z",
    "readScale": "Disabled",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 50
    },
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "maintenanceConfigurationId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1",
    "isLedgerOn": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a database with specified backup storage redundancy.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2021-11-01

{
  "location": "southeastasia",
  "properties": {
    "requestedBackupStorageRedundancy": "Zone"
  }
}

Sample response

{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Zone",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Zone",
    "requestedServiceObjectiveName": "S0",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "Standard",
    "tier": "Standard",
    "capacity": 10
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "maxSizeBytes": 268435456000,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "currentSku": {
      "name": "Standard",
      "tier": "Standard",
      "capacity": 10
    },
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentBackupStorageRedundancy": "Zone",
    "currentServiceObjectiveName": "S0",
    "defaultSecondaryLocation": "North Europe",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "readScale": "Disabled",
    "requestedBackupStorageRedundancy": "Zone",
    "requestedServiceObjectiveName": "S0",
    "zoneRedundant": false,
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a VCore database by specifying service objective name.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2021-11-01

{
  "location": "southeastasia",
  "sku": {
    "name": "BC",
    "family": "Gen4",
    "capacity": 2
  }
}

Sample response

{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "readScale": "Enabled",
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 2
    }
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "readScale": "Enabled",
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "isLedgerOn": false,
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 2
    }
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Creates a VCore database by specifying sku name and capacity.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb?api-version=2021-11-01

{
  "location": "southeastasia",
  "sku": {
    "name": "BC_Gen4",
    "capacity": 2
  }
}

Sample response

{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "readScale": "Enabled",
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 2
    }
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}
{
  "sku": {
    "name": "BC_Gen4",
    "tier": "BusinessCritical",
    "family": "Gen4",
    "capacity": 2
  },
  "kind": "v12.0,user",
  "properties": {
    "collation": "SQL_Latin1_General_CP1_CI_AS",
    "earliestRestoreDate": "2017-06-07T04:51:33.937Z",
    "maxSizeBytes": 1073741824,
    "status": "Online",
    "databaseId": "6c764297-577b-470f-9af4-96d3d41e2ba3",
    "creationDate": "2017-06-07T04:41:33.937Z",
    "currentServiceObjectiveName": "BC_Gen4_2",
    "defaultSecondaryLocation": "North Europe",
    "catalogCollation": "SQL_Latin1_General_CP1_CI_AS",
    "licenseType": "LicenseIncluded",
    "maxLogSizeBytes": 104857600,
    "readScale": "Enabled",
    "currentBackupStorageRedundancy": "Geo",
    "requestedBackupStorageRedundancy": "Geo",
    "isLedgerOn": false,
    "isInfraEncryptionEnabled": false,
    "zoneRedundant": false,
    "currentSku": {
      "name": "BC_Gen4",
      "tier": "BusinessCritical",
      "capacity": 2
    }
  },
  "location": "southeastasia",
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
  "name": "testdb",
  "type": "Microsoft.Sql/servers/databases"
}

Definitions

Name Description
BackupStorageRedundancy

The storage account type used to store backups for this database.

CatalogCollationType

Collation of the metadata catalog.

CreateMode

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.

Database

A database resource.

DatabaseIdentity

Azure Active Directory identity configuration for a resource.

DatabaseIdentityType

The identity type

DatabaseLicenseType

The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.

DatabaseReadScale

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. Not applicable to a Hyperscale database within an elastic pool.

DatabaseStatus

The status of the database.

DatabaseUserIdentity

Azure Active Directory identity configuration for a resource.

SampleName

The name of the sample schema to apply when creating this database.

SecondaryType

The secondary type of the database if it is a secondary. Valid values are Geo and Named.

Sku

An ARM Resource SKU.

BackupStorageRedundancy

The storage account type used to store backups for this database.

Name Type Description
Geo

string

GeoZone

string

Local

string

Zone

string

CatalogCollationType

Collation of the metadata catalog.

Name Type Description
DATABASE_DEFAULT

string

SQL_Latin1_General_CP1_CI_AS

string

CreateMode

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.

Name Type Description
Copy

string

Default

string

OnlineSecondary

string

PointInTimeRestore

string

Recovery

string

Restore

string

RestoreExternalBackup

string

RestoreExternalBackupSecondary

string

RestoreLongTermRetentionBackup

string

Secondary

string

Database

A database resource.

Name Type Description
id

string

Resource ID.

identity

DatabaseIdentity

The Azure Active Directory identity of the database.

kind

string

Kind of database. This is metadata used for the Azure portal experience.

location

string

Resource location.

managedBy

string

Resource that manages the database.

name

string

Resource name.

properties.autoPauseDelay

integer

Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled

properties.catalogCollation

CatalogCollationType

Collation of the metadata catalog.

properties.collation

string

The collation of the database.

properties.createMode

CreateMode

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.

properties.creationDate

string

The creation date of the database (ISO8601 format).

properties.currentBackupStorageRedundancy

BackupStorageRedundancy

The storage account type used to store backups for this database.

properties.currentServiceObjectiveName

string

The current service level objective name of the database.

properties.currentSku

Sku

The name and tier of the SKU.

properties.databaseId

string

The ID of the database.

properties.defaultSecondaryLocation

string

The default secondary region for this database.

properties.earliestRestoreDate

string

This records the earliest start date and time that restore is available for this database (ISO8601 format).

properties.elasticPoolId

string

The resource identifier of the elastic pool containing this database.

properties.failoverGroupId

string

Failover Group resource identifier that this database belongs to.

properties.federatedClientId

string

The Client id used for cross tenant per database CMK scenario

properties.highAvailabilityReplicaCount

integer

The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool.

properties.isInfraEncryptionEnabled

boolean

Infra encryption is enabled for this database.

properties.isLedgerOn

boolean

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.

properties.licenseType

DatabaseLicenseType

The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.

properties.longTermRetentionBackupResourceId

string

The resource identifier of the long term retention backup associated with create operation of this database.

properties.maintenanceConfigurationId

string

Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.

properties.maxLogSizeBytes

integer

The max log size for this database.

properties.maxSizeBytes

integer

The max size of the database expressed in bytes.

properties.minCapacity

number

Minimal capacity that database will always have allocated, if not paused

properties.pausedDate

string

The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.

properties.readScale

DatabaseReadScale

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. Not applicable to a Hyperscale database within an elastic pool.

properties.recoverableDatabaseId

string

The resource identifier of the recoverable database associated with create operation of this database.

properties.recoveryServicesRecoveryPointId

string

The resource identifier of the recovery point associated with create operation of this database.

properties.requestedBackupStorageRedundancy

BackupStorageRedundancy

The storage account type to be used to store backups for this database.

properties.requestedServiceObjectiveName

string

The requested service level objective name of the database.

properties.restorableDroppedDatabaseId

string

The resource identifier of the restorable dropped database associated with create operation of this database.

properties.restorePointInTime

string

Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.

properties.resumedDate

string

The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.

properties.sampleName

SampleName

The name of the sample schema to apply when creating this database.

properties.secondaryType

SecondaryType

The secondary type of the database if it is a secondary. Valid values are Geo and Named.

properties.sourceDatabaseDeletionDate

string

Specifies the time that the database was deleted.

properties.sourceDatabaseId

string

The resource identifier of the source database associated with create operation of this database.

properties.sourceResourceId

string

The resource identifier of the source associated with the create operation of this database.

This property is only supported for DataWarehouse edition and allows to restore across subscriptions.

When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover.

When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing database or existing sql pool, and restorePointInTime must be specified.

When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped sql pool.

When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool.

When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. For more details about “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant

properties.status

DatabaseStatus

The status of the database.

properties.zoneRedundant

boolean

Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.

sku

Sku

The database SKU.

The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the Capabilities_ListByLocation REST API or one of the following commands:

az sql db list-editions -l <location> -o table
Get-AzSqlServerServiceObjective -Location <location>
tags

object

Resource tags.

type

string

Resource type.

DatabaseIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
tenantId

string

The Azure Active Directory tenant id.

type

DatabaseIdentityType

The identity type

userAssignedIdentities

<string,  DatabaseUserIdentity>

The resource ids of the user assigned identities to use

DatabaseIdentityType

The identity type

Name Type Description
None

string

UserAssigned

string

DatabaseLicenseType

The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid Benefit.

Name Type Description
BasePrice

string

LicenseIncluded

string

DatabaseReadScale

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. Not applicable to a Hyperscale database within an elastic pool.

Name Type Description
Disabled

string

Enabled

string

DatabaseStatus

The status of the database.

Name Type Description
AutoClosed

string

Copying

string

Creating

string

Disabled

string

EmergencyMode

string

Inaccessible

string

Offline

string

OfflineChangingDwPerformanceTiers

string

OfflineSecondary

string

Online

string

OnlineChangingDwPerformanceTiers

string

Paused

string

Pausing

string

Recovering

string

RecoveryPending

string

Restoring

string

Resuming

string

Scaling

string

Shutdown

string

Standby

string

Starting

string

Stopped

string

Stopping

string

Suspect

string

DatabaseUserIdentity

Azure Active Directory identity configuration for a resource.

Name Type Description
clientId

string

The Azure Active Directory client id.

principalId

string

The Azure Active Directory principal id.

SampleName

The name of the sample schema to apply when creating this database.

Name Type Description
AdventureWorksLT

string

WideWorldImportersFull

string

WideWorldImportersStd

string

SecondaryType

The secondary type of the database if it is a secondary. Valid values are Geo and Named.

Name Type Description
Geo

string

Named

string

Sku

An ARM Resource SKU.

Name Type Description
capacity

integer

Capacity of the particular SKU.

family

string

If the service has different generations of hardware, for the same SKU, then that can be captured here.

name

string

The name of the SKU, typically, a letter + Number code, e.g. P3.

size

string

Size of the particular SKU

tier

string

The tier or edition of the particular SKU, e.g. Basic, Premium.