Share via


Keys - Create Or Update

Creates or updates a workspace key

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys/{keyName}?api-version=2021-06-01

URI Parameters

Name In Required Type Description
keyName
path True

string

The name of the workspace key

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

minLength: 1

The ID of the target subscription.

workspaceName
path True

string

The name of the workspace.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
properties.isActiveCMK

boolean

Used to activate the workspace after a customer managed key is provided.

properties.keyVaultUrl

string

The Key Vault Url of the workspace key.

Responses

Name Type Description
200 OK

Key

Workspace Key resource details

Other Status Codes

ErrorResponse

*** Error Responses: ***

  • 400 BadRequest - Invalid request to create a Workspace Key.

  • 500 InternalServerError- Some error occurred while creating Workspace Key.

Examples

Create or update a workspace key

Sample request

PUT https://management.azure.com/subscriptions/01234567-89ab-4def-0123-456789abcdef/resourceGroups/ExampleResourceGroup/providers/Microsoft.Synapse/workspaces/ExampleWorkspace/keys/somekey?api-version=2021-06-01

{
  "properties": {
    "isActiveCMK": true,
    "keyVaultUrl": "https://vault.azure.net/keys/somesecret"
  }
}

Sample response

{
  "id": "/subscriptions/01234567-89ab-4def-0123-456789abcdef/resourceGroups/ExampleResourceGroup/providers/Microsoft.Synapse/workspaces/ExampleWorkspace/keys/somekey",
  "type": "Microsoft.Synapse/workspaces/keys",
  "name": "somekey",
  "properties": {
    "isActiveCMK": true,
    "keyVaultUrl": "https://vault.azure.net/keys/somesecret"
  }
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

Key

A workspace key

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

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

Key

A workspace key

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

The name of the resource

properties.isActiveCMK

boolean

Used to activate the workspace after a customer managed key is provided.

properties.keyVaultUrl

string

The Key Vault Url of the workspace key.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"