Share via


Services - List Test Keys

列出服務的測試金鑰。

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys?api-version=2023-12-01

URI 參數

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

string

包含資源的資源群組名稱。 您可以從 Azure 資源管理員 API 或入口網站取得這個值。

serviceName
path True

string

服務資源的名稱。

Regex pattern: ^[a-z][a-z0-9-]*[a-z0-9]$

subscriptionId
path True

string

取得可唯一識別 Microsoft Azure 訂用帳戶的訂用帳戶標識碼。 訂用帳戶識別碼會構成每個服務呼叫 URI 的一部分。

api-version
query True

string

用於此作業的 API 版本。

回應

名稱 類型 Description
200 OK

TestKeys

成功。 回應描述測試金鑰。

Other Status Codes

CloudError

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

安全性

azure_auth

Azure Active Directory OAuth2 Flow

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

Scopes

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

範例

Services_ListTestKeys

Sample Request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/listTestKeys?api-version=2023-12-01

Sample Response

{
  "primaryKey": "<primaryKey>",
  "secondaryKey": "<secondaryKey>",
  "primaryTestEndpoint": "<primaryTestEndpoint>",
  "secondaryTestEndpoint": "<secondaryTestEndpoint>",
  "enabled": true
}

定義

名稱 Description
CloudError

來自服務的錯誤回應。

CloudErrorBody

來自服務的錯誤回應。

TestKeys

測試金鑰承載

CloudError

來自服務的錯誤回應。

名稱 類型 Description
error

CloudErrorBody

來自服務的錯誤回應。

CloudErrorBody

來自服務的錯誤回應。

名稱 類型 Description
code

string

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

details

CloudErrorBody[]

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

message

string

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

target

string

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

TestKeys

測試金鑰承載

名稱 類型 Description
enabled

boolean

指出是否啟用測試端點功能

primaryKey

string

主索引鍵

primaryTestEndpoint

string

主要測試端點

secondaryKey

string

次要索引鍵

secondaryTestEndpoint

string

次要測試端點