Communication Service - Regenerate Key
重新生成密钥
重新生成 CommunicationService 访问密钥。 无法同时重新生成 PrimaryKey 和 SecondaryKey。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/regenerateKey?api-version=2020-08-20
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
communication
|
path | True |
string minLength: 1maxLength: 63 pattern: ^[-\w]+$ |
CommunicationService 资源的名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| keyType |
要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
创建。 响应包含新密钥。 |
|
| Other Status Codes |
描述操作失败的原因的错误响应。 |
示例
Regenerate key
示例请求
POST https://management.azure.com/subscriptions/12345/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/communicationServices/MyCommunicationResource/regenerateKey?api-version=2020-08-20
{
"keyType": "Primary"
}
示例响应
{
"primaryKey": "1234",
"primaryConnectionString": "endpoint=http://example.com;accesskey=1234"
}
定义
| 名称 | 说明 |
|---|---|
|
Communication |
一个表示 CommunicationService 的访问密钥的类。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Key |
要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。 |
|
Regenerate |
参数描述重新生成访问密钥的请求 |
CommunicationServiceKeys
一个表示 CommunicationService 的访问密钥的类。
| 名称 | 类型 | 说明 |
|---|---|---|
| primaryConnectionString |
string |
通过 primaryKey 构造的 CommunicationService 连接字符串 |
| primaryKey |
string |
主访问密钥。 |
| secondaryConnectionString |
string |
通过 secondaryKey 构造的 CommunicationService 连接字符串 |
| secondaryKey |
string |
辅助访问密钥。 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
KeyType
要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。
| 值 | 说明 |
|---|---|
| Primary | |
| Secondary |
RegenerateKeyParameters
参数描述重新生成访问密钥的请求
| 名称 | 类型 | 说明 |
|---|---|---|
| keyType |
要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。 |