你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Database Accounts - Get Read Only Keys

Lists the read-only access keys for the specified Azure Cosmos DB database account.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys?api-version=2024-08-15

URI Parameters

Name In Required Type Description
accountName
path True

string

Cosmos DB database account name.

Regex pattern: ^[a-z0-9]+(-[a-z0-9]+)*

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

Responses

Name Type Description
200 OK

DatabaseAccountListReadOnlyKeysResult

The operation completed successfully.

Security

azure_auth

Azure Active Directory OAuth2 Flow

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

Scopes

Name Description
user_impersonation Impersonate your user account

Examples

CosmosDBDatabaseAccountListReadOnlyKeys

Sample request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/readonlykeys?api-version=2024-08-15

Sample response

{
  "primaryReadonlyMasterKey": "primaryReadonlyMasterKey",
  "secondaryReadonlyMasterKey": "secondaryReadonlyMasterKey"
}

Definitions

DatabaseAccountListReadOnlyKeysResult

The read-only access keys for the given database account.

Name Type Description
primaryReadonlyMasterKey

string

Base 64 encoded value of the primary read-only key.

secondaryReadonlyMasterKey

string

Base 64 encoded value of the secondary read-only key.