Databases - Import Export - Export

Exports a database to a bacpac.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export?api-version=2014-04-01

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

The subscription ID that identifies an Azure subscription.

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.

serverName
path True
  • string

The name of the server.

databaseName
path True
  • string

The name of the database to be exported.

api-version
query True
  • string

The API version to use for the request.

Request Body

Name Required Type Description
administratorLogin True
  • string

The name of the SQL administrator.

administratorLoginPassword True
  • string

The password of the SQL administrator.

authenticationType

The authentication type.

storageKey True
  • string

The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?."

storageKeyType True

The type of the storage key to use.

storageUri True
  • string

The storage uri to use.

Responses

Name Type Description
200 OK

OK

202 Accepted

Accepted

Examples

Export a database into a new bacpac file with SAS key
Export a database into a new bacpac file with storage key

Export a database into a new bacpac file with SAS key

Sample Request

POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdb/export?api-version=2014-04-01
{
  "storageKeyType": "SharedAccessKey",
  "storageKey": "?sr=b&sp=rw&se=2018-01-01T00%3A00%3A00Z&sig=sdfsdfklsdjflSLIFJLSIEJFLKSDJFDd/%2wdfskdjf3%3D&sv=2015-07-08",
  "storageUri": "https://test.blob.core.windows.net/bacpacs/testbacpac.bacpac",
  "administratorLogin": "dummyLogin",
  "administratorLoginPassword": "Un53cuRE!",
  "authenticationType": "SQL"
}

Sample Response

Export a database into a new bacpac file with storage key

Sample Request

POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/databases/testdb/export?api-version=2014-04-01
{
  "storageKeyType": "StorageAccessKey",
  "storageKey": "sdlfkjdsf+sdlfkjsdlkfsjdfLDKFJSDLKFDFKLjsdfksjdflsdkfD2342309432849328479324/3RSD==",
  "storageUri": "https://test.blob.core.windows.net/bacpacs/testbacpac.bacpac",
  "administratorLogin": "dummyLogin",
  "administratorLoginPassword": "Un53cuRE!",
  "authenticationType": "SQL"
}

Sample Response

Definitions

AuthenticationType

The authentication type.

ExportRequest

Export database parameters.

ImportExportResponse

Response for Import/Export Get operation.

StorageKeyType

The type of the storage key to use.

AuthenticationType

The authentication type.

Name Type Description
ADPassword
  • string
SQL
  • string

ExportRequest

Export database parameters.

Name Type Description
administratorLogin
  • string

The name of the SQL administrator.

administratorLoginPassword
  • string

The password of the SQL administrator.

authenticationType

The authentication type.

storageKey
  • string

The storage key to use. If storage key type is SharedAccessKey, it must be preceded with a "?."

storageKeyType

The type of the storage key to use.

storageUri
  • string

The storage uri to use.

ImportExportResponse

Response for Import/Export Get operation.

Name Type Description
id
  • string

Resource ID.

name
  • string

Resource name.

properties.blobUri
  • string

The blob uri.

properties.databaseName
  • string

The name of the database.

properties.errorMessage
  • string

The error message returned from the server.

properties.lastModifiedTime
  • string

The operation status last modified time.

properties.queuedTime
  • string

The operation queued time.

properties.requestId
  • string

The request type of the operation.

properties.requestType
  • string

The request type of the operation.

properties.serverName
  • string

The name of the server.

properties.status
  • string

The status message returned from the server.

type
  • string

Resource type.

StorageKeyType

The type of the storage key to use.

Name Type Description
SharedAccessKey
  • string
StorageAccessKey
  • string