Communication Services - Regenerate Key

Regenerate Key
Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/regenerateKey?api-version=2023-03-31

URI Parameters

Name In Required Type Description
communicationServiceName
path True

string

The name of the CommunicationService resource.

Regex pattern: ^[-\w]+$

resourceGroupName
path True

string

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

subscriptionId
path True

string

uuid

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

The API version to use for this operation.

Request Body

Name Type Description
keyType

KeyType

The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive).

Responses

Name Type Description
200 OK

CommunicationServiceKeys

Regenerate key request was completed successfully. The response contains the new key.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Examples

Regenerate key

Sample request

POST https://management.azure.com/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/communicationServices/MyCommunicationResource/regenerateKey?api-version=2023-03-31

{
  "keyType": "Primary"
}

Sample response

{
  "primaryKey": "1234",
  "primaryConnectionString": "endpoint=http://example.com;accesskey=1234"
}

Definitions

Name Description
CommunicationServiceKeys

A class representing the access keys of a CommunicationService.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

KeyType

The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive).

RegenerateKeyParameters

Parameters describes the request to regenerate access keys

CommunicationServiceKeys

A class representing the access keys of a CommunicationService.

Name Type Description
primaryConnectionString

string

CommunicationService connection string constructed via the primaryKey

primaryKey

string

The primary access key.

secondaryConnectionString

string

CommunicationService connection string constructed via the secondaryKey

secondaryKey

string

The secondary access 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.

KeyType

The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive).

Name Type Description
Primary

string

Secondary

string

RegenerateKeyParameters

Parameters describes the request to regenerate access keys

Name Type Description
keyType

KeyType

The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive).