Managed Databases - Complete Restore

Completes the restore operation on a managed database.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore?api-version=2021-11-01

URI Parameters

Name In Required Type Description
databaseName
path True

string

The name of the database.

managedInstanceName
path True

string

The name of the managed instance.

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.

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
lastBackupName True

string

The last backup name to apply

Responses

Name Type Description
200 OK

Successfully completed restore request.

202 Accepted

Completing restore request is in progress.

Other Status Codes

*** Error Responses: ***

  • 400 InvalidDatabaseCompleteRestoreRequest - The complete database restore request is invalid

  • 400 InvalidDatabaseCompleteRestoreRequestLastBackupName - The last backup name is invalid

  • 400 InvalidIdentifier - The identifier contains NULL or an invalid unicode character.

  • 400 SourceDatabaseNotFound - The source database does not exist.

  • 400 TokenTooLong - The provided token is too long.

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

  • 400 TargetServerDoesNotExist - The target server {0} does not exist or is not ready yet. Please check that it exists and retry the restore request.

  • 400 TargetServerRestoreNotAllowed - The target server {0} is currently not in a state that allows a restore to be started.

  • 400 BackupSetNotFound - No backups were found to restore the database. Please contact support to restore the database.

  • 400 FullBackupNotFound - Full backup can not be found.

  • 400 MissingThumbprint - Can not find server certificate.

  • 400 RestoreFromStripedBackupsNotEnabled - Restoring from striped backups is not supported.

  • 400 BackupSetBroken - Backup set is broken.

  • 400 BrokenRestorePlanNoFullBackup - The restore plan is broken because there is no full backup.

  • 400 SqlRestoreError - Non retriable error occurred while restoring backup with index {0} - {1} {2}

  • 400 BrokenRestorePlanWrongLogBackupLSN - The restore plan is broken because firstLsn of current log backup is not <= lastLsn of next log backup.

  • 400 BrokenRestorePlanWrongDiffBackupLSN - The restore plan is broken because firstLsn of diff backup is not >= firstLsn of full backup.

  • 400 BrokenRestorePlanGapInLogBackups - The restore plan is broken because firstLsn of current log backup is not equal to lastLsn of prev log backup.

  • 400 PartiallyContainedDatabaseUnsupported - "Backup for a partially contained database is not supported."

  • 400 RequiredBackupIsNotLastRestored - Migration cannot be completed because provided backup file name is not the name of the last backup file that is restored.

  • 400 XtpInitializedDuringRestore - Memory-optimized filegroup must be empty in order to be restored on General Purpose tier of SQL Database Managed Instance.

  • 400 FullBackupMissingChecksum - Provided full backup is missing checksum.

  • 400 FullBackupDamaged - Provided full backup is damaged.

  • 400 MissingStripeInBackupSet - Provided backup set has one or more missing stripes.

  • 400 BrokenRestorePlanWrongDiffBaseGUID - The restore plan is broken because DifferentialBaseGuid of diff backup does not match BackupSetGuid of full backup.

  • 400 IncompatiblePhysicalLayoutTooFewDataFiles - Database backup contains incompatible physical layout. No data files are found in the backup.

  • 400 CorruptedPagesInBackupSet - Operation was aborted because RESTORE detected one or more corrupted pages in the backup set.

  • 400 IncompatiblePhysicalLayoutNonOnlineDataFilesExist - Database backup contains incompatible physical layout. Non-online data files exist.

  • 400 CorruptedPagesListMaintenance - Operation was aborted because an internal error occurred while processing the backup taken without checksum.

  • 400 IncompatiblePhysicalLayoutWrongNumberOfLogFiles - Database backup contains incompatible physical layout. Multiple log files are not supported.

  • 400 IncompatiblePhysicalLayoutNonOnlineLogFilesExist - Database backup contains incompatible physical layout. Non-online log files exist.

  • 400 IncompatiblePhysicalLayoutTooManyNonDataLogFiles - Database backup contains incompatible physical layout. Too many non-data/log files.

  • 400 ExternalBackupAlreadySignaledToComplete - The restore request has already been signaled to complete.

  • 400 ExternalBackupRestoreHasNotBeenStarted - The restore request can only be completed once the restore has started.

  • 400 ExternalBackupUpgradeInProgress - The restore request cannot be completed, since upgrade is in progress.

  • 400 IncompatiblePhysicalLayoutTooManyXTPFiles - Database backup contains incompatible physical layout. Multiple files found in the filegroup that contains MEMORY_OPTIMIZED_DATA.

  • 400 BlobStorageFailure - Blob storage failure has occurred.

  • 400 BackupsFromMultipleDatabasesDetectedInTheContainerFromTheStart - There are backups from multiple databases in the container folder. Please make sure the container folder has backups from a single database.{0}

  • 400 ManagedIdentityIssueDetectedFromTheStart - Managed identity is not set up properly. Please verify and try again.

  • 400 ManagedInstanceStorageLimitHit - The managed instance has reached its storage limit.

  • 400 AutoCompleteMissingLastBackupName - Auto complete restore request must have lastBackupName parameter provided.

  • 400 BlobStorageServerFailure - Blob storage server failure has occurred.

  • 400 BackupsFromMultipleDatabasesDetectedInTheContainerWhileRestoreInProgress - There are backups from multiple databases in the container folder. Please make sure the container folder has backups from a single database.{0}

  • 400 ManagedIdentityIssueDetectedWhileRestoreInProgress - Managed identity is not set up properly. Please verify and try again.

  • 404 ResourceDoesNotExist - Resource with the name '{0}' does not exist. To continue, specify a valid resource name.

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

  • 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.

  • 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.

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

Examples

Completes a managed database external backup restore.

Sample Request

POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/completeRestore?api-version=2021-11-01

{
  "lastBackupName": "testdb1_log4"
}

Sample Response

Definitions

CompleteDatabaseRestoreDefinition

Contains the information necessary to perform a complete database restore operation.

Name Type Description
lastBackupName

string

The last backup name to apply