Managed Databases - Update
Updates an existing database.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}?api-version=2025-01-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
database
|
path | True |
string |
The name of the database. |
|
managed
|
path | True |
string |
The name of the managed instance. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Type | Description |
|---|---|---|
| properties.autoCompleteRestore |
boolean |
Whether to auto complete restore of this managed database. |
| properties.catalogCollation |
Collation of the metadata catalog. |
|
| properties.collation |
string |
Collation of the managed database. |
| properties.createMode |
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). |
|
| properties.crossSubscriptionRestorableDroppedDatabaseId |
string |
The restorable cross-subscription dropped database resource id to restore when creating this database. |
| properties.crossSubscriptionSourceDatabaseId |
string |
The resource identifier of the cross-subscription source database associated with create operation of this database. |
| properties.crossSubscriptionTargetManagedInstanceId |
string |
Target managed instance id used in cross-subscription restore. |
| 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.lastBackupName |
string |
Last backup file name for restore of this managed database. |
| properties.longTermRetentionBackupResourceId |
string |
The name of the Long Term Retention backup to be used for restore of this managed database. |
| properties.recoverableDatabaseId |
string |
The resource identifier of the recoverable database associated with create operation of this database. |
| properties.restorableDroppedDatabaseId |
string |
The restorable dropped database resource id to restore when creating this database. |
| properties.restorePointInTime |
string (date-time) |
Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. |
| properties.sourceDatabaseId |
string |
The resource identifier of the source database associated with create operation of this database. |
| properties.storageContainerIdentity |
string |
Conditional. If createMode is RestoreExternalBackup, this value is used. Specifies the identity used for storage container authentication. Can be 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is assumed. |
| properties.storageContainerSasToken |
string |
Conditional. If createMode is RestoreExternalBackup and storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage container sas token. |
| properties.storageContainerUri |
string |
Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. |
| tags |
object |
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Azure operation completed successfully. |
|
| 202 Accepted |
Resource update request accepted. Headers
|
|
| Other Status Codes |
An unexpected error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
| Updates a managed database with maximal properties |
| Updates a managed database with minimal properties |
Updates a managed database with maximal properties
Sample request
PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/testdb?api-version=2025-01-01
{
"tags": {
"tagKey1": "TagValue1"
}
}
Sample response
{
"name": "testdb",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
"location": "southeastasia",
"tags": {
"tagKey1": "TagValue1"
}
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/locations/southeastasia/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2017-03-01
Updates a managed database with minimal properties
Sample request
PATCH https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/managedInstance/databases/testdb?api-version=2025-01-01
{
"tags": {
"tagKey1": "TagValue1"
}
}
Sample response
{
"name": "testdb",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb",
"location": "southeastasia",
"tags": {
"tagKey1": "TagValue1"
}
}
Location: https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/locations/southeastasia/operationStatus/default/operationId/00000000-0000-0000-0000-000000000000?api-version=2017-03-01
Definitions
| Name | Description |
|---|---|
|
Catalog |
Collation of the metadata catalog. |
|
created |
The type of identity that created the resource. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Inaccessibility |
Root cause kind. Allowed values are “TransparentDataEncryption”, “DatabaseReplication”, and “Unknown”. |
|
Managed |
A managed database resource. |
|
Managed |
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). |
|
Managed |
Managed Database Extended Accessibility Information |
|
Managed |
Status of the database. |
|
Managed |
An managed database update. |
|
system |
Metadata pertaining to creation and last modification of the resource. |
CatalogCollationType
Collation of the metadata catalog.
| Value | Description |
|---|---|
| DATABASE_DEFAULT |
DATABASE_DEFAULT |
| SQL_Latin1_General_CP1_CI_AS |
SQL_Latin1_General_CP1_CI_AS |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
InaccessibilityReason
Root cause kind. Allowed values are “TransparentDataEncryption”, “DatabaseReplication”, and “Unknown”.
| Value | Description |
|---|---|
| Unknown |
Unknown |
| TransparentDataEncryption |
TransparentDataEncryption |
| DatabaseReplication |
DatabaseReplication |
ManagedDatabase
A managed database resource.
| Name | Type | Description |
|---|---|---|
| id |
string (arm-id) |
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
| location |
string |
The geo-location where the resource lives |
| name |
string |
The name of the resource |
| properties.autoCompleteRestore |
boolean |
Whether to auto complete restore of this managed database. |
| properties.catalogCollation |
Collation of the metadata catalog. |
|
| properties.collation |
string |
Collation of the managed database. |
| properties.createMode |
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). |
|
| properties.creationDate |
string (date-time) |
Creation date of the database. |
| properties.crossSubscriptionRestorableDroppedDatabaseId |
string |
The restorable cross-subscription dropped database resource id to restore when creating this database. |
| properties.crossSubscriptionSourceDatabaseId |
string |
The resource identifier of the cross-subscription source database associated with create operation of this database. |
| properties.crossSubscriptionTargetManagedInstanceId |
string |
Target managed instance id used in cross-subscription restore. |
| properties.defaultSecondaryLocation |
string |
Geo paired region. |
| properties.earliestRestorePoint |
string (date-time) |
Earliest restore point in time for point in time restore. |
| properties.extendedAccessibilityInfo |
Additional observability and troubleshooting information for databases in ‘Inaccessible’ state. |
|
| properties.failoverGroupId |
string |
Instance Failover Group resource identifier that this managed database belongs to. |
| 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.lastBackupName |
string |
Last backup file name for restore of this managed database. |
| properties.longTermRetentionBackupResourceId |
string |
The name of the Long Term Retention backup to be used for restore of this managed database. |
| properties.recoverableDatabaseId |
string |
The resource identifier of the recoverable database associated with create operation of this database. |
| properties.restorableDroppedDatabaseId |
string |
The restorable dropped database resource id to restore when creating this database. |
| properties.restorePointInTime |
string (date-time) |
Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. |
| properties.sourceDatabaseId |
string |
The resource identifier of the source database associated with create operation of this database. |
| properties.status |
Status of the database. |
|
| properties.storageContainerIdentity |
string |
Conditional. If createMode is RestoreExternalBackup, this value is used. Specifies the identity used for storage container authentication. Can be 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is assumed. |
| properties.storageContainerSasToken |
string |
Conditional. If createMode is RestoreExternalBackup and storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage container sas token. |
| properties.storageContainerUri |
string |
Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. |
| systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
| tags |
object |
Resource tags. |
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
ManagedDatabaseCreateMode
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required).
| Value | Description |
|---|---|
| Default |
Default |
| RestoreExternalBackup |
RestoreExternalBackup |
| PointInTimeRestore |
PointInTimeRestore |
| Recovery |
Recovery |
| RestoreLongTermRetentionBackup |
RestoreLongTermRetentionBackup |
ManagedDatabaseExtendedAccessibilityInfo
Managed Database Extended Accessibility Information
| Name | Type | Description |
|---|---|---|
| inaccessibilityReasonDescription |
string |
Root cause explanation and mitigation action. |
| inaccessibilityReasonErrorCode |
string |
SQL Server error code connected to the inaccessibility root cause. |
| inaccessibilityReasonKind |
Root cause kind. Allowed values are “TransparentDataEncryption”, “DatabaseReplication”, and “Unknown”. |
|
| inaccessibilityReasonTdeKeyUri |
string |
For the root cause kind “TransparentDataEncryption”, the CMK URI. |
ManagedDatabaseStatus
Status of the database.
| Value | Description |
|---|---|
| Online |
Online |
| Offline |
Offline |
| Shutdown |
Shutdown |
| Creating |
Creating |
| Inaccessible |
Inaccessible |
| Restoring |
Restoring |
| Updating |
Updating |
| Stopping |
Stopping |
| Stopped |
Stopped |
| Starting |
Starting |
| DbMoving |
DbMoving |
| DbCopying |
DbCopying |
ManagedDatabaseUpdate
An managed database update.
| Name | Type | Description |
|---|---|---|
| properties.autoCompleteRestore |
boolean |
Whether to auto complete restore of this managed database. |
| properties.catalogCollation |
Collation of the metadata catalog. |
|
| properties.collation |
string |
Collation of the managed database. |
| properties.createMode |
Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). |
|
| properties.creationDate |
string (date-time) |
Creation date of the database. |
| properties.crossSubscriptionRestorableDroppedDatabaseId |
string |
The restorable cross-subscription dropped database resource id to restore when creating this database. |
| properties.crossSubscriptionSourceDatabaseId |
string |
The resource identifier of the cross-subscription source database associated with create operation of this database. |
| properties.crossSubscriptionTargetManagedInstanceId |
string |
Target managed instance id used in cross-subscription restore. |
| properties.defaultSecondaryLocation |
string |
Geo paired region. |
| properties.earliestRestorePoint |
string (date-time) |
Earliest restore point in time for point in time restore. |
| properties.extendedAccessibilityInfo |
Additional observability and troubleshooting information for databases in ‘Inaccessible’ state. |
|
| properties.failoverGroupId |
string |
Instance Failover Group resource identifier that this managed database belongs to. |
| 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.lastBackupName |
string |
Last backup file name for restore of this managed database. |
| properties.longTermRetentionBackupResourceId |
string |
The name of the Long Term Retention backup to be used for restore of this managed database. |
| properties.recoverableDatabaseId |
string |
The resource identifier of the recoverable database associated with create operation of this database. |
| properties.restorableDroppedDatabaseId |
string |
The restorable dropped database resource id to restore when creating this database. |
| properties.restorePointInTime |
string (date-time) |
Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. |
| properties.sourceDatabaseId |
string |
The resource identifier of the source database associated with create operation of this database. |
| properties.status |
Status of the database. |
|
| properties.storageContainerIdentity |
string |
Conditional. If createMode is RestoreExternalBackup, this value is used. Specifies the identity used for storage container authentication. Can be 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is assumed. |
| properties.storageContainerSasToken |
string |
Conditional. If createMode is RestoreExternalBackup and storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage container sas token. |
| properties.storageContainerUri |
string |
Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. |
| tags |
object |
Resource tags. |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |