Communication Service - 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=2020-08-20
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 minLength: 1 |
The ID of the target subscription. |
|
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 |
Created. The response contains the new key. |
|
| Other Status Codes |
Error response describing why the operation failed. |
Examples
Regenerate key
Sample request
POST https://management.azure.com/subscriptions/12345/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/communicationServices/MyCommunicationResource/regenerateKey?api-version=2020-08-20
{
"keyType": "Primary"
}
Sample response
{
"primaryKey": "1234",
"primaryConnectionString": "endpoint=http://example.com;accesskey=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 | |
| 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). |