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 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
communication
|
path | True |
string |
CommunicationService 資源的名稱。 Regex 模式: |
resource
|
path | True |
string |
資源群組的名稱。 名稱不區分大小寫。 |
subscription
|
path | True |
string |
目標訂用帳戶的標識碼。 |
api-version
|
query | True |
string |
要用於這項作業的 API 版本。 |
要求本文
名稱 | 類型 | Description |
---|---|---|
keyType |
要重新產生的keyType。 必須是 'primary' 或 'secondary'(不區分大小寫)。 |
回應
名稱 | 類型 | Description |
---|---|---|
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"
}
定義
名稱 | Description |
---|---|
Communication |
類別,表示 CommunicationService 的存取密鑰。 |
Error |
資源管理錯誤其他資訊。 |
Error |
錯誤詳細數據。 |
Error |
錯誤回應 |
Key |
要重新產生的keyType。 必須是 'primary' 或 'secondary'(不區分大小寫)。 |
Regenerate |
參數描述重新產生存取密鑰的要求 |
CommunicationServiceKeys
類別,表示 CommunicationService 的存取密鑰。
名稱 | 類型 | Description |
---|---|---|
primaryConnectionString |
string |
透過 primaryKey 建構的 CommunicationService 連接字串 |
primaryKey |
string |
主要存取金鑰。 |
secondaryConnectionString |
string |
透過 secondaryKey 建構的 CommunicationService 連接字串 |
secondaryKey |
string |
次要存取金鑰。 |
ErrorAdditionalInfo
資源管理錯誤其他資訊。
名稱 | 類型 | Description |
---|---|---|
info |
object |
其他資訊。 |
type |
string |
其他信息類型。 |
ErrorDetail
錯誤詳細數據。
名稱 | 類型 | Description |
---|---|---|
additionalInfo |
錯誤其他資訊。 |
|
code |
string |
錯誤碼。 |
details |
錯誤詳細數據。 |
|
message |
string |
錯誤訊息。 |
target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
名稱 | 類型 | Description |
---|---|---|
error |
error 物件。 |
KeyType
要重新產生的keyType。 必須是 'primary' 或 'secondary'(不區分大小寫)。
名稱 | 類型 | Description |
---|---|---|
Primary |
string |
|
Secondary |
string |
RegenerateKeyParameters
參數描述重新產生存取密鑰的要求
名稱 | 類型 | Description |
---|---|---|
keyType |
要重新產生的keyType。 必須是 'primary' 或 'secondary'(不區分大小寫)。 |