Create Database Restore Request (classic)

 

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

Restore an Azure SQL Database.

Important

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.

Request

The Create Database Restore Request request must be specified as follows:

  • Replace {subscriptionId} with your subscription ID.

  • Replace {serverName} with the name of the server containing the database you want to restore.

Method Request URI HTTP Version
POST https://management.core.windows.net:8443/{subscriptionId}/services/sqlservers/servers/{serverName}/restoredatabaseoperations HTTP/1.1

Executing this method submits a request to restore a specific database. The time to complete the request can vary depending on the attributes of the database. Use Database Operation Status (classic) to query the status of the operation.

URI Parameters

None.

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="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
  <SourceDatabaseName>sourceDb</SourceDatabaseName>  
  <SourceDatabaseDeletionDate>2013-08-29T21:38:54.5330000Z</SourceDatabaseDeletionDate> <!-- Optional, only applies when restoring a dropped database. -->  
  <TargetDatabaseName>targetDb</TargetDatabaseName>  
  <TargetUtcPointInTime>2013-09-03T00:00:00.0000000Z</TargetUtcPointInTime> <!-- Optional -->  
</ServiceResource>  

The following table describes the elements of the request body:

Element Name Description
SourceDatabaseName The name of the database to restore.
SourceDatabaseDeletionDate Optional. The date and time (including milliseconds) when the database was dropped. (Only applies to restoring a dropped database.)
TargetDatabaseName The name of the new database after restore.
TargetUtcPointInTime Optional. The point in time to restore the database from.

Response

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

Status Code

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="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
  <Name />  
  <Type>Microsoft.SqlAzure.RestoreDatabaseOperation</Type>  
  <State>Created</State>  
  <SelfLink>https://management.core.windows.net/2eae7c21-ffd1-49e4-ac22-39095e0b9f02/services/sqlservers/servers/bpr0d6li5t/restoredatabaseoperations/885315a9-4b52-418f-8fb9-988c1d5e9972</SelfLink>  
  <ParentLink>https://management.core.windows.net/2eae7c21-ffd1-49e4-ac22-39095e0b9f02/services/sqlservers/servers/bpr0d6li5t</ParentLink>  
  <RequestID>885315a9-4b52-418f-8fb9-988c1d5e9972</RequestID>  
  <SourceDatabaseName>sourceDb</SourceDatabaseName>  
  <SourceDatabaseDeletionDate>2013-08-29T21:38:54.5330000</SourceDatabaseDeletionDate>  
  <TargetDatabaseName>targetDb</TargetDatabaseName>  
  <TargetUtcPointInTime>2013-09-03T00:00:00.0000000Z</TargetUtcPointInTime>  
</ServiceResource>  
Element Name Description
Name The name of this service resource.
Type The type of the service resource; Microsoft.SqlAzure.RestoreDatabaseOperation.
State The state of this service resource.
SelfLink The URI identifier for this resource.
ParentLink The URI identifier for the parent of this resource (the server).
RequestID The identifier for this request.
SourceDatabaseName The name of the database to restore.
SourceDatabaseDeletionDate The date and time when the database was deleted.
TargetDatabaseName The name of the new database after restore.
TargetUtcPointInTime The point in time the database was restored from.

See Also

Restore an Azure SQL database using Point in Time Restore with REST API
Restore a deleted Azure SQL database with REST API
Common REST API Error Codes
Azure SQL Database
Operations for Azure SQL Databases
Get Database Restore Request (classic)
Get Restorable Dropped Database (classic)
List Restorable Dropped Databases (classic)
Azure SQL Database Cmdlets
Start-AzureSqlDatabaseRestore