你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Database Accounts - List Keys
Lists指定的 Azure Cosmos DB 数据库帐户的访问密钥。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys?api-version=2024-05-15
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
account
|
path | True |
string |
Cosmos DB 数据库帐户名称。 Regex pattern: |
resource
|
path | True |
string |
资源组的名称。 此名称不区分大小写。 |
subscription
|
path | True |
string |
目标订阅的 ID。 |
api-version
|
query | True |
string |
要用于此操作的 API 版本。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
操作已成功完成。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
CosmosDBDatabaseAccountListKeys
Sample Request
Sample Response
{
"primaryMasterKey": "primaryMasterKey",
"secondaryMasterKey": "secondaryMasterKey",
"primaryReadonlyMasterKey": "primaryReadonlyMasterKey",
"secondaryReadonlyMasterKey": "secondaryReadonlyMasterKey"
}
定义
DatabaseAccountListKeysResult
给定数据库帐户的访问密钥。
名称 | 类型 | 说明 |
---|---|---|
primaryMasterKey |
string |
主读写键的 Base 64 编码值。 |
primaryReadonlyMasterKey |
string |
主只读密钥的 Base 64 编码值。 |
secondaryMasterKey |
string |
辅助读写键的 Base 64 编码值。 |
secondaryReadonlyMasterKey |
string |
辅助只读密钥的 Base 64 编码值。 |