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 參數

名稱 位於 必要 類型 Description
databaseName
path True

string

要匯出的資料庫名稱。

resourceGroupName
path True

string

包含資源的資源群組名稱。 您可以從 Azure Resource Manager API 或入口網站取得此值。

serverName
path True

string

伺服器的名稱。

subscriptionId
path True

string

識別 Azure 訂用帳戶的訂用帳戶標識碼。

api-version
query True

string

要用於要求的 API 版本。

要求本文

名稱 類型 Description
parameters

ExportRequest

匯出資料庫所需的參數。

回應

名稱 類型 Description
200 OK

ImportExportResponse

還行

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
  }
}

定義

名稱 Description
AuthenticationType

驗證類型。

ExportRequest

匯出資料庫所需的參數。

ImportExportResponse

匯入/匯出取得作業的回應。

StorageKeyType

要使用的記憶體金鑰類型。

AuthenticationType

驗證類型。

Description
SQL
ADPassword

ExportRequest

匯出資料庫所需的參數。

名稱 類型 預設值 Description
administratorLogin

string

SQL 系統管理員的名稱。

administratorLoginPassword

string

SQL 系統管理員的密碼。

authenticationType

AuthenticationType

SQL

驗證類型。

storageKey

string

要使用的記憶體金鑰。 如果記憶體密鑰類型為 SharedAccessKey,則必須在前面加上 “?”。

storageKeyType

StorageKeyType

要使用的記憶體金鑰類型。

storageUri

string

要使用的記憶體 URI。

ImportExportResponse

匯入/匯出取得作業的回應。

名稱 類型 Description
id

string

資源標識碼。

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

要使用的記憶體金鑰類型。

Description
StorageAccessKey
SharedAccessKey