Databases - Export
Exports a database.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export?api-version=2025-01-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
database
|
path | True |
string |
The name of the database. |
|
resource
|
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. |
|
server
|
path | True |
string |
The name of the server. |
|
subscription
|
path | True |
string |
The subscription ID that identifies an Azure subscription. |
|
api-version
|
query | True |
string |
The API version to use for the request. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| administratorLogin | True |
string |
Administrator login name. If AuthenticationType is ManagedIdentity, this field should specify the Managed Identity's resource ID. |
| storageKey | True |
string |
Storage key for the storage account. If StorageKeyType is ManagedIdentity, this field should specify the Managed Identity's resource ID. |
| storageKeyType | True |
Storage key type: StorageAccessKey, SharedAccessKey, or ManagedIdentity. |
|
| storageUri | True |
string |
Storage Uri. |
| administratorLoginPassword |
string |
Administrator login password. If AuthenticationType is ManagedIdentity, this field should not be specified. |
|
| authenticationType |
string |
Type of credentials provided for access to the target SQL server: SQL, ADPassword or ManagedIdentity. |
|
| networkIsolation |
Optional resource information to enable network isolation for request. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Successfully exported the database. |
|
| 202 Accepted |
Exporting the database is in progress. Headers Location: string |
|
| Other Status Codes |
*** Error Responses: ***
|
Examples
Exports a database, using Managed Identity to communicate with SQL server and storage account.
Sample request
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/export?api-version=2025-01-01
{
"storageKeyType": "ManagedIdentity",
"storageKey": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName",
"storageUri": "https://test.blob.core.windows.net/test.bacpac",
"administratorLogin": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName",
"authenticationType": "ManagedIdentity"
}
Sample response
{
"properties": {
"requestId": "9d9a794a-5cec-4f23-af70-d29511b522a4",
"requestType": "Export",
"queuedTime": "2/2/2020 8:33:27 PM",
"lastModifiedTime": "2/2/2020 8:34:47 PM",
"blobUri": "https://test.blob.core.windows.net/test.bacpac",
"serverName": "testsvr.database.windows.net",
"databaseName": "testdb",
"status": "Completed"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4",
"name": "9d9a794a-5cec-4f23-af70-d29511b522a4",
"type": "Microsoft.Sql/servers/databases/importExportOperationResults"
}
Location: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Sql/locations/japaneast/importExportOperationResults/00000000-0000-0000-0000-000000000000
Exports a database, using private link to communicate with SQL server and storage account.
Sample request
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/export?api-version=2025-01-01
{
"storageKeyType": "StorageAccessKey",
"storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==",
"storageUri": "https://test.blob.core.windows.net/test.bacpac",
"administratorLogin": "login",
"administratorLoginPassword": "password",
"authenticationType": "Sql",
"networkIsolation": {
"sqlServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr",
"storageAccountResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"
}
}
Sample response
{
"properties": {
"requestId": "9d9a794a-5cec-4f23-af70-d29511b522a4",
"requestType": "Export",
"queuedTime": "2/2/2020 8:33:27 PM",
"lastModifiedTime": "2/2/2020 8:34:47 PM",
"blobUri": "https://test.blob.core.windows.net/test.bacpac",
"serverName": "testsvr.database.windows.net",
"databaseName": "testdb",
"status": "Completed"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4",
"name": "9d9a794a-5cec-4f23-af70-d29511b522a4",
"type": "Microsoft.Sql/servers/databases/importExportOperationResults"
}
Location: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Sql/locations/japaneast/importExportOperationResults/00000000-0000-0000-0000-000000000000
Exports a database.
Sample request
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/export?api-version=2025-01-01
{
"storageKeyType": "StorageAccessKey",
"storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==",
"storageUri": "https://test.blob.core.windows.net/test.bacpac",
"administratorLogin": "login",
"administratorLoginPassword": "password",
"authenticationType": "Sql"
}
Sample response
{
"properties": {
"requestId": "9d9a794a-5cec-4f23-af70-d29511b522a4",
"requestType": "Export",
"queuedTime": "2/2/2020 8:33:27 PM",
"lastModifiedTime": "2/2/2020 8:34:47 PM",
"blobUri": "https://test.blob.core.windows.net/test.bacpac",
"serverName": "testsvr.database.windows.net",
"databaseName": "testdb",
"status": "Completed"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/importExportOperationResults/9d9a794a-5cec-4f23-af70-d29511b522a4",
"name": "9d9a794a-5cec-4f23-af70-d29511b522a4",
"type": "Microsoft.Sql/servers/databases/importExportOperationResults"
}
Location: /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Sql/locations/japaneast/importExportOperationResults/00000000-0000-0000-0000-000000000000
Definitions
| Name | Description |
|---|---|
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Export |
Contains the information necessary to perform export database operation. |
|
Import |
An ImportExport operation result resource. |
|
Network |
Contains the ARM resources for which to create private endpoint connection. |
|
Private |
Contains the private endpoint connection requests status. |
|
Storage |
Storage key type: StorageAccessKey, SharedAccessKey, or ManagedIdentity. |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
ExportDatabaseDefinition
Contains the information necessary to perform export database operation.
| Name | Type | Description |
|---|---|---|
| administratorLogin |
string |
Administrator login name. If AuthenticationType is ManagedIdentity, this field should specify the Managed Identity's resource ID. |
| administratorLoginPassword |
string |
Administrator login password. If AuthenticationType is ManagedIdentity, this field should not be specified. |
| authenticationType |
string |
Type of credentials provided for access to the target SQL server: SQL, ADPassword or ManagedIdentity. |
| networkIsolation |
Optional resource information to enable network isolation for request. |
|
| storageKey |
string |
Storage key for the storage account. If StorageKeyType is ManagedIdentity, this field should specify the Managed Identity's resource ID. |
| storageKeyType |
Storage key type: StorageAccessKey, SharedAccessKey, or ManagedIdentity. |
|
| storageUri |
string |
Storage Uri. |
ImportExportOperationResult
An ImportExport operation result resource.
| Name | Type | Description |
|---|---|---|
| id |
string |
Resource ID. |
| name |
string |
Resource name. |
| properties.blobUri |
string |
Blob Uri. |
| properties.databaseName |
string |
Database name. |
| properties.errorMessage |
string |
Error message. |
| properties.lastModifiedTime |
string |
Last modified time. |
| properties.privateEndpointConnections |
Gets the status of private endpoints associated with this request. |
|
| properties.queuedTime |
string |
Queued time. |
| properties.requestId |
string (uuid) |
Request Id. |
| properties.requestType |
string |
Request type. |
| properties.serverName |
string |
Server name. |
| properties.status |
string |
Operation status. |
| type |
string |
Resource type. |
NetworkIsolationSettings
Contains the ARM resources for which to create private endpoint connection.
| Name | Type | Description |
|---|---|---|
| sqlServerResourceId |
string (arm-id) |
The resource id for the SQL server which is the target of this request. If set, private endpoint connection will be created for the SQL server. Must match server which is target of the operation. |
| storageAccountResourceId |
string (arm-id) |
The resource id for the storage account used to store BACPAC file. If set, private endpoint connection will be created for the storage account. Must match storage account used for StorageUri parameter. |
PrivateEndpointConnectionRequestStatus
Contains the private endpoint connection requests status.
| Name | Type | Description |
|---|---|---|
| privateEndpointConnectionName |
string |
The connection name for the private endpoint. |
| privateLinkServiceId |
string |
Resource id for which the private endpoint is created. |
| status |
string |
Status of this private endpoint connection. |
StorageKeyType
Storage key type: StorageAccessKey, SharedAccessKey, or ManagedIdentity.
| Value | Description |
|---|---|
| SharedAccessKey | |
| StorageAccessKey | |
| ManagedIdentity |