Export Database (classic)

 

Updated: October 5, 2016

THIS TOPIC APPLIES TO: noSQL Server yesAzure SQL DatabaseyesAzure SQL Data Warehouse noParallel 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.

MethodRequest URIHTTP Version
POSThttps://management.core.windows.net:8443/{subscriptionId}/services/sqlservers/servers/{serverName}/DacOperations/ExportHTTP/1.1

URI Parameters

None.

Request Headers

The following table describes the required and optional request headers:

Request HeaderDescription
x-ms-versionRequired. Specifies the version of the operation to use for this request. This header should be set to 2012-03-01.
x-ms-client-request-idOptional. 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 NameDescription
BlobCredentialsThe required information to connect to blob storage to save the BACPAC.
BlobCredentials:URIThe URI of the BACPAC to export.
BlobCredentials:StorageAccessKeyThe primary access key for accessing storage.
ConnectionInfoThe required information for connecting to the Azure SQL Database.
ConnectionInfo:DatabaseNameThe name of the database to export.
ConnectionInfo:PasswordThe password for connecting to the Azure SQL Database Server that contains the database.
ConnectionInfo:ServerNameThe name of the server that the database will be exported from. This must be the fully qualified domain name of the server.
ConnectionInfo:UserNameThe 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 HeaderDescription
x-ms-request-idA 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 NameDescription
guidThe 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

Show: