Skip to main content

database_accounts_keys

Creates, updates, deletes, gets or lists a database_accounts_keys resource.

Overview

Namedatabase_accounts_keys
TypeResource
Idazure.cosmos_db.database_accounts_keys

Fields

The following fields are returned by SELECT queries:

The operation completed successfully.

NameDatatypeDescription
primaryMasterKeystringBase 64 encoded value of the primary read-write key.
primaryReadonlyMasterKeystringBase 64 encoded value of the primary read-only key.
secondaryMasterKeystringBase 64 encoded value of the secondary read-write key.
secondaryReadonlyMasterKeystringBase 64 encoded value of the secondary read-only key.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectsubscriptionId, resourceGroupName, accountNameLists the access keys for the specified Azure Cosmos DB database account.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
accountNamestringCosmos DB database account name.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
subscriptionIdstringThe ID of the target subscription.

SELECT examples

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

SELECT
primaryMasterKey,
primaryReadonlyMasterKey,
secondaryMasterKey,
secondaryReadonlyMasterKey
FROM azure.cosmos_db.database_accounts_keys
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND accountName = '{{ accountName }}' -- required
;