共用方式為


Batch Account - Regenerate Key

重新產生 Batch 帳戶的指定帳戶金鑰。
此作業僅適用於包含 『SharedKey』 的 allowedAuthenticationModes 的 Batch 帳戶。 如果 Batch 帳戶在其 allowedAuthenticationMode 中未包含 'SharedKey',則客戶端無法使用共用密鑰進行驗證,而且必須改用另一個 allowedAuthenticationModes。 在此情況下,重新產生金鑰將會失敗。

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys?api-version=2024-07-01

URI 參數

名稱 位於 必要 類型 Description
accountName
path True

string

minLength: 3
maxLength: 24
pattern: ^[a-zA-Z0-9]+$

Batch 帳戶的名稱。

resourceGroupName
path True

string

包含 Batch 帳戶的資源群組名稱。

subscriptionId
path True

string

Azure 訂用帳戶標識碼。 這是 GUID 格式的字串(例如 0000000000-0000-0000-0000-0000000000000000)

api-version
query True

string

要與 HTTP 要求搭配使用的 API 版本。

要求本文

名稱 必要 類型 Description
keyName True

AccountKeyType

要重新產生之帳戶金鑰的類型。

回應

名稱 類型 Description
200 OK

BatchAccountKeys

作業成功。 回應包含 Batch 帳戶金鑰。

Other Status Codes

CloudError

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Microsoft Entra OAuth 2.0 驗證碼流程

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

BatchAccountRegenerateKey

範例要求

POST https://management.azure.com/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/regenerateKeys?api-version=2024-07-01

{
  "keyName": "Primary"
}

範例回覆

{
  "accountName": "sampleacct",
  "primary": "AAAA==",
  "secondary": "BBBB=="
}

定義

名稱 Description
AccountKeyType

要重新產生之帳戶金鑰的類型。

BatchAccountKeys

一組 Azure Batch 帳戶金鑰。

BatchAccountRegenerateKeyParameters

提供給 RegenerateKey 作業的參數。

CloudError

Batch 服務的錯誤回應。

CloudErrorBody

Batch 服務的錯誤回應。

AccountKeyType

要重新產生之帳戶金鑰的類型。

Description
Primary

主要帳戶金鑰。

Secondary

次要帳戶金鑰。

BatchAccountKeys

一組 Azure Batch 帳戶金鑰。

名稱 類型 Description
accountName

string

Batch 帳戶名稱。

primary

string

與帳戶相關聯的主鍵。

secondary

string

與帳戶相關聯的次要密鑰。

BatchAccountRegenerateKeyParameters

提供給 RegenerateKey 作業的參數。

名稱 類型 Description
keyName

AccountKeyType

要重新產生之帳戶金鑰的類型。

CloudError

Batch 服務的錯誤回應。

名稱 類型 Description
error

CloudErrorBody

錯誤回應的主體。

CloudErrorBody

Batch 服務的錯誤回應。

名稱 類型 Description
code

string

錯誤的識別碼。 程序代碼是不變的,而且是要以程序設計方式取用。

details

CloudErrorBody[]

錯誤的其他詳細數據清單。

message

string

描述錯誤的訊息,適用於在使用者介面中顯示。

target

string

特定錯誤的目標。 例如,錯誤中的屬性名稱。