Communication Services - Regenerate Key
重新生成密钥
重新生成 CommunicationService 访问密钥。 无法同时重新生成 PrimaryKey 和 SecondaryKey。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/regenerateKey?api-version=2025-09-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
communication
|
path | True |
string minLength: 1maxLength: 63 pattern: ^[-\w]+$ |
CommunicationService 资源的名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| keyType |
要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
重新生成密钥请求已成功完成。 响应包含了新的密钥。 |
|
| Other Status Codes |
描述作失败的原因的错误响应。 |
示例
Regenerate key
示例请求
示例响应
{
"primaryKey": "1234",
"primaryConnectionString": "endpoint=http://example.com;accesskey=1234"
}
定义
| 名称 | 说明 |
|---|---|
|
Communication |
一个代表通信服务访问密钥的类。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Key |
要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。 |
|
Regenerate |
参数描述重新生成访问密钥的请求 |
CommunicationServiceKeys
一个代表通信服务访问密钥的类。
| 名称 | 类型 | 说明 |
|---|---|---|
| primaryConnectionString |
string |
通过 primaryKey 构建的 CommunicationService 连接字符串 |
| primaryKey |
string |
主访问密钥。 |
| secondaryConnectionString |
string |
通过次要密钥构建的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”(不区分大小写)。 |