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=2026-03-18
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
communication
|
path | True |
string minLength: 1maxLength: 63 pattern: ^[-\w]+$ |
The name of the CommunicationService resource. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Type | Description |
|---|---|---|
| keyType |
The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Azure operation completed successfully. |
|
| Other Status Codes |
An unexpected error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
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=2026-03-18
{
"keyType": "Primary"
}
Sample response
{
"primaryConnectionString": "endpoint=http://example.com;accesskey=1234",
"primaryKey": "1234"
}
Definitions
| Name | Description |
|---|---|
|
Communication |
A class representing the access keys of a CommunicationService. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Key |
The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). |
|
Regenerate |
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 |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
KeyType
The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive).
| Value | Description |
|---|---|
| Primary |
Primary |
| Secondary |
Secondary |
RegenerateKeyParameters
Parameters describes the request to regenerate access keys
| Name | Type | Description |
|---|---|---|
| keyType |
The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). |