Export Database (classic)
Updated: October 5, 2016
SQL Server
Azure SQL Database
Azure SQL Data Warehouse
Parallel Data Warehouse
Exports an Azure SQL Database to Blob storage as a BACPAC file.
This command uses the classic deployment model. You should use the newer Resource Manager based REST API commands located here. For more information, see Azure Resource Manager vs. classic deployment: Understand deployment models and the state of your resources.
The Export Database request must be specified as follows:
Replace {subscriptionId} with your subscription ID.
Replace {serverName} with the name of the source server.
| Method | Request URI | HTTP Version |
|---|---|---|
| POST | https://management.core.windows.net:8443/{subscriptionId}/services/sqlservers/servers/{serverName}/DacOperations/Export | HTTP/1.1 |
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.
<ExportInput xmlns="http://schemas.datacontract.org/2004/07/Microsoft.SqlServer.Management.Dac.ServiceTypes" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<BlobCredentials i:type="BlobStorageAccessKeyCredentials">
<Uri>{uriBase}</Uri>
<StorageAccessKey>+Ka1LjBc36Pa62WOCJ9zXJjlN5qU6YU3B2JYTgSfw8xiQKlrBoOmAEcdJSO3/YPA5JcJAmMSWCyQB7w1D96k8A==</StorageAccessKey>
</BlobCredentials>
<ConnectionInfo>
<DatabaseName>{dbName}</DatabaseName>
<Password>{myPassword}</Password>
<ServerName>{serverName}.database.windows.net</ServerName>
<UserName>{mylogin}</UserName>
</ConnectionInfo>
</ExportInput>
The following table describes the elements of the request body:
| Element Name | Description |
|---|---|
| BlobCredentials | The required information to connect to blob storage to save the BACPAC. |
| BlobCredentials:URI | The URI of the BACPAC to export. |
| BlobCredentials:StorageAccessKey | The primary access key for accessing storage. |
| ConnectionInfo | The required information for connecting to the Azure SQL Database. |
| ConnectionInfo:DatabaseName | The name of the database to export. |
| ConnectionInfo:Password | The password for connecting to the Azure SQL Database Server that contains the database. |
| ConnectionInfo:ServerName | The name of the server that the database will be exported from. This must be the fully qualified domain name of the server. |
| ConnectionInfo:UserName | The user name to connect to the Azure SQL Database Server. |
The response includes an HTTP status code, a set of response headers, and a response body.
Status Code
Successful export of the database returns a status of 'OK'.
Response Headers
The response for this operation includes the following headers.
| 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
<guid xmlns=”http://schemas.microsoft.com/2003/10/Serialization/”>00000000-0000-0000-0001-000000000001</guid>
The following table describes the elements in the response body:
| Element Name | Description |
|---|---|
| guid | The RequestID for this operation. Use the request id to query the service for the status of the operation. |
Common REST API Error Codes
Azure SQL Database
Operations for Azure SQL Databases
Azure SQL Database Cmdlets