Database Extensions - Create Or Update

Perform a database extension operation, like polybase import

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}?api-version=2021-02-01-preview

URI Parameters

Name In Required Type Description
databaseName
path True
  • string

The name of the database.

extensionName
path True
  • string
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.

subscriptionId
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
properties.operationMode True

Operation Mode.

properties.storageKey True
  • string

Storage key.

properties.storageKeyType True

Storage key type.

properties.storageUri True
  • string

Storage Uri.

Responses

Name Type Description
200 OK

Successfully completed import/export operation.

202 Accepted

Import/Export operation is in progress.

Other Status Codes

*** Error Responses: ***

  • 400 MissingImportExportInputParameters - Missing ImportExport input parameters.

  • 400 PolybaseImportAuthenticationTypeNotSupported - Authentication type parameter is not support for PolybaseImport operation.

  • 400 DatabaseExtensionsInvalidOperationMode - Invalid operationMode parameter for database extension.

  • 400 DatabaseExtensionsInvalidStorageKeyType - The storage key type must by 'StorageAccessKey'.

  • 400 DatabaseExtensionsMissingStorageUri - Storage URI cannot be empty.

  • 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.

  • 400 InvalidOperationType - Provide a valid operation type.

  • 400 ImportExportJobError - The ImportExport operation has failed.

  • 400 BlockedByOutboundFirewall - The outbound firewall rules blocked the request.

  • 404 ResourceNotFound - Invalid request specifying a non-existent resource.

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 ImportExportOperationIdNotFound - The operation Id for import or export cannot be found.

  • 404 ServerNotInSubscription - Specified server does not exist on the specified subscription.

  • 409 ImportExportOperationInProgress - There is an import or export operation in progress on the database.

Examples

Create or Update database extensions.

Sample Request

PUT https://management.azure.com/subscriptions/a1c0814d-3c18-4e1e-a247-c128c12b1677/resourceGroups/rg_20cbe0f0-c2d9-4522-9177-5469aad53029/providers/Microsoft.Sql/servers/srv_1ffd1cf8-9951-47fb-807d-a9c384763849/databases/878e303f-1ea0-4f17-aa3d-a22ac5e9da08/extensions/polybaseimport?api-version=2021-02-01-preview
{
  "properties": {
    "operationMode": "PolybaseImport",
    "storageKeyType": "StorageAccessKey",
    "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "storageUri": "https://teststorage.blob.core.windows.net/testcontainer/Manifest.xml"
  }
}

Sample Response

{
  "properties": {
    "requestId": "10000000-0000-0000-0000-000000000002",
    "requestType": "PolybaseImport",
    "lastModifiedTime": "lastModifiedTime",
    "serverName": "srv_1ffd1cf8-9951-47fb-807d-a9c384763849",
    "databaseName": "878e303f-1ea0-4f17-aa3d-a22ac5e9da08",
    "status": "succeeded"
  },
  "id": "10000000-0000-0000-0000-000000000002",
  "name": "10000000-0000-0000-0000-000000000002",
  "type": "Microsoft.Sql/servers/databases/extensions"
}

Definitions

DatabaseExtensions

An export managed database operation result resource.

ImportExportExtensionsOperationResult

An Extension operation result resource.

OperationMode

Operation Mode.

StorageKeyType

Storage key type.

DatabaseExtensions

An export managed database operation result resource.

Name Type Description
id
  • string

Resource ID.

name
  • string

Resource name.

properties.operationMode

Operation Mode.

properties.storageKey
  • string

Storage key.

properties.storageKeyType

Storage key type.

properties.storageUri
  • string

Storage Uri.

type
  • string

Resource type.

ImportExportExtensionsOperationResult

An Extension operation result resource.

Name Type Description
id
  • string

Resource ID.

name
  • string

Resource name.

properties.databaseName
  • string

Database name.

properties.errorMessage
  • string

Error message.

properties.lastModifiedTime
  • string

Last modified time.

properties.requestId
  • string

Request Id.

properties.requestType
  • string

Request type.

properties.serverName
  • string

Server name.

properties.status
  • string

Operation status.

type
  • string

Resource type.

OperationMode

Operation Mode.

Name Type Description
PolybaseImport
  • string

StorageKeyType

Storage key type.

Name Type Description
SharedAccessKey
  • string
StorageAccessKey
  • string