Batch Account - Get Keys

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

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

URI 參數

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

string

Batch 帳戶的名稱。

Regex pattern: ^[a-zA-Z0-9]+$

resourceGroupName
path True

string

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

subscriptionId
path True

string

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

api-version
query True

string

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

回應

名稱 類型 Description
200 OK

BatchAccountKeys

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

Other Status Codes

CloudError

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

安全性

azure_auth

Microsoft Entra OAuth 2.0 驗證碼流程

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

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

範例

BatchAccountGetKeys

Sample Request

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

Sample Response

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

定義

名稱 Description
BatchAccountKeys

一組 Azure Batch 帳戶金鑰。

CloudError

Batch 服務的錯誤回應。

CloudErrorBody

Batch 服務的錯誤回應。

BatchAccountKeys

一組 Azure Batch 帳戶金鑰。

名稱 類型 Description
accountName

string

Batch 帳戶名稱。

primary

string

與帳戶相關聯的主鍵。

secondary

string

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

CloudError

Batch 服務的錯誤回應。

名稱 類型 Description
error

CloudErrorBody

錯誤回應的本文。

CloudErrorBody

Batch 服務的錯誤回應。

名稱 類型 Description
code

string

錯誤的識別碼。 程式碼不變,且要以程式設計方式使用。

details

CloudErrorBody[]

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

message

string

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

target

string

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