你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Communication Services - Regenerate Key

重新生成密钥
重新生成 CommunicationService 访问密钥。 无法同时重新生成 PrimaryKey 和 SecondaryKey。

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

URI 参数

名称 必需 类型 说明
communicationServiceName
path True

string

CommunicationService 资源的名称。

正则表达式模式: ^[-\w]+$

resourceGroupName
path True

string

资源组的名称。 名称不区分大小写。

subscriptionId
path True

string

uuid

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

用于此操作的 API 版本。

请求正文

名称 类型 说明
keyType

KeyType

要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。

响应

名称 类型 说明
200 OK

CommunicationServiceKeys

重新生成密钥请求已成功完成。 响应包含新密钥。

Other Status Codes

ErrorResponse

描述操作失败的原因的错误响应。

示例

Regenerate key

示例请求

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

{
  "keyType": "Primary"
}

示例响应

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

定义

名称 说明
CommunicationServiceKeys

一个表示 CommunicationService 的访问密钥的类。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

KeyType

要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。

RegenerateKeyParameters

参数描述重新生成访问密钥的请求

CommunicationServiceKeys

一个表示 CommunicationService 的访问密钥的类。

名称 类型 说明
primaryConnectionString

string

通过 primaryKey 构造的 CommunicationService 连接字符串

primaryKey

string

主访问密钥。

secondaryConnectionString

string

通过 secondaryKey 构造的 CommunicationService 连接字符串

secondaryKey

string

辅助访问密钥。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

KeyType

要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。

名称 类型 说明
Primary

string

Secondary

string

RegenerateKeyParameters

参数描述重新生成访问密钥的请求

名称 类型 说明
keyType

KeyType

要重新生成的 keyType。 必须是“primary”或“secondary”(不区分大小写)。