Create Database Recovery Request (classic)


THIS TOPIC APPLIES TO: noSQL Server yesAzure SQL DatabaseyesAzure SQL Data Warehouse noParallel Data Warehouse

Recover an Azure SQL Database.


The recommended REST commands to work with SQL Database are the Resource Manager based Azure SQL Database REST API. While there is no change to SQL Database, be aware that the classic deployment model command in this article is scheduled for deprecation on December 1, 2019. For a table providing links to the specific new commands you should use, see Operations for Azure SQL Databases.


The Create Database Recovery Request must be specified as follows:

  • Replace {subscriptionId} with your subscription ID.

  • Replace {sourceServerName} with the server name where the recoverable database is located.

Method Request URI HTTP Version
POST{subscriptionId}/servers/{sourceServerName}/recoverdatabaseoperations HTTP/1.1

The time to recover a database will vary depending on the size and attributes of the specific database. Use Database Operation Status (classic) to check the status of a recovery operation.

URI Parameters


Request Headers

The following table describes the required and optional request headers:

Request Header Description
x-ms-version Required. Specifies the version of the operation to use for this request. This header should be set to 2012-03-01.
x-ms-client-request-id Optional. Provides a client-generated, opaque value with a 1 KB character limit. Using this header is highly recommended for correlating client-side activities with requests received by the server.

Request Body

The format of the request body is as follows:

<ServiceResource xmlns="">  

The following table describes the elements of the request body:

Element Name Description
SourceDatabaseName The name of the database to recover.
TargetServerName The name of the server to recover the database to.
TargetDatabaseName The name of the database to recover to.


The TargetDatabaseName must not be the name of a live database already on the server. The {sourceDatabaseName} and {targetDatabaseName} should not use system reserved names, such as master, tempdb, model, msdb, for example.


The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

Response status code 201 (Created) indicates the request succeeded.

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Header Description
x-ms-request-id A value that uniquely identifies a request made against the database management service. This request id is used for request tracking. If a failure occurs that requires the user to contact Microsoft Support, the request id should be provided to Microsoft to assist in tracking and resolving the failure for the request.

Response Body

The following is an example response body:

<ServiceResource xmlns="" xmlns:i="">  
  <Name i:nil="true" />  
  <SelfLink i:nil="true" />  
  <ParentLink i:nil="true" />  

The following table describes the elements in the response body:

Element Name Description
SourceDatabaseName The name of the database being recovered.
TargetServerName The name of the server where the database will be recovered to.
TargetDatabaseName The name for the recovered database.


To check if a specific database is available for recovery, see Get Recoverable Database (classic). For a complete list of databases that can be recovered, see List Recoverable Databases (classic).

See Also

Recover an Azure SQL database using Geo-Restore with REST API
Common REST API Error Codes
Azure SQL Database
Operations for Azure SQL Databases
Azure SQL Database Cmdlets