Databases - Export
将数据库导出到 bacpac。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export?api-version=2014-04-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
database
|
path | True |
string |
要导出的数据库的名称。 |
|
resource
|
path | True |
string |
包含资源的资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。 |
|
server
|
path | True |
string |
服务器的名称。 |
|
subscription
|
path | True |
string |
标识 Azure 订阅的订阅 ID。 |
|
api-version
|
query | True |
string |
要用于请求的 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| parameters |
导出数据库所需的参数。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
还行 |
|
| 202 Accepted |
已接受 |
示例
| 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
示例请求
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": "<administratorLoginPassword>",
"authenticationType": "SQL"
}
示例响应
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/importExportOperationResult/f01d7bfe-7162-44e7-9350-f1c85ce83e4c",
"name": "f01d7bfe-7162-44e7-9350-f1c85ce83e4c",
"type": "Microsoft.Sql/servers/importExportOperationResults",
"properties": {
"requestId": "f01d7bfe-7162-44e7-9350-f1c85ce83e4c",
"requestType": "Export",
"queuedTime": "3/1/2017 12:14:25 AM",
"lastModifiedTime": "3/1/2017 12:16:33 AM",
"blobUri": "https://test.blob.core.windows.net/bacpacs/test.bacpac",
"serverName": "test",
"databaseName": "testdb",
"status": "Completed",
"errorMessage": null
}
}
Export a database into a new bacpac file with storage key
示例请求
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": "<administratorLoginPassword>",
"authenticationType": "SQL"
}
示例响应
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-4799/providers/Microsoft.Sql/servers/sqlcrudtest-5961/importExportOperationResult/f01d7bfe-7162-44e7-9350-f1c85ce83e4c",
"name": "f01d7bfe-7162-44e7-9350-f1c85ce83e4c",
"type": "Microsoft.Sql/servers/importExportOperationResults",
"properties": {
"requestId": "f01d7bfe-7162-44e7-9350-f1c85ce83e4c",
"requestType": "Export",
"queuedTime": "3/1/2017 12:14:25 AM",
"lastModifiedTime": "3/1/2017 12:16:33 AM",
"blobUri": "https://test.blob.core.windows.net/bacpacs/test.bacpac",
"serverName": "test",
"databaseName": "testdb",
"status": "Completed",
"errorMessage": null
}
}
定义
| 名称 | 说明 |
|---|---|
|
Authentication |
身份验证类型。 |
|
Export |
导出数据库所需的参数。 |
|
Import |
导入/导出获取作的响应。 |
|
Storage |
要使用的存储密钥的类型。 |
AuthenticationType
身份验证类型。
| 值 | 说明 |
|---|---|
| SQL | |
| ADPassword |
ExportRequest
导出数据库所需的参数。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| administratorLogin |
string |
SQL 管理员的名称。 |
|
| administratorLoginPassword |
string |
SQL 管理员的密码。 |
|
| authenticationType | SQL |
身份验证类型。 |
|
| storageKey |
string |
要使用的存储密钥。 如果存储密钥类型为 SharedAccessKey,则其前面必须有“?”。 |
|
| storageKeyType |
要使用的存储密钥的类型。 |
||
| storageUri |
string |
要使用的存储 URI。 |
ImportExportResponse
导入/导出获取作的响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
| name |
string |
资源名称。 |
| properties.blobUri |
string |
Blob URI。 |
| properties.databaseName |
string |
数据库的名称。 |
| properties.errorMessage |
string |
从服务器返回的错误消息。 |
| properties.lastModifiedTime |
string |
上次修改的作状态。 |
| properties.queuedTime |
string |
作排队时间。 |
| properties.requestId |
string (uuid) |
作的请求类型。 |
| properties.requestType |
string |
作的请求类型。 |
| properties.serverName |
string |
服务器的名称。 |
| properties.status |
string |
从服务器返回的状态消息。 |
| type |
string |
资源类型。 |
StorageKeyType
要使用的存储密钥的类型。
| 值 | 说明 |
|---|---|
| StorageAccessKey | |
| SharedAccessKey |