Database Accounts - Regenerate Key

Regenerates an access key for the specified Azure Cosmos DB database account.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey?api-version=2015-04-08

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

Azure subscription ID.

resourceGroupName
path True
  • string

Name of an Azure resource group.

Regex pattern: ^[-\w\._\(\)]+$

accountName
path True
  • string

Cosmos DB database account name.

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

api-version
query True
  • string

Version of the API to be used with the client request. The current version is 2015-04-08.

Request Body

Name Required Type Description
keyKind True

The access key to regenerate.

Responses

Name Type Description
200 OK

OK

202 Accepted

Accepted. The regenerate key operation will complete asynchronously.

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

CosmosDBDatabaseAccountRegenerateKey

Sample Request

POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/regenerateKey?api-version=2015-04-08
{
  "keyKind": "primary"
}

Sample Response

Definitions

DatabaseAccountRegenerateKeyParameters

Parameters to regenerate the keys within the database account.

KeyKind

The access key to regenerate.

DatabaseAccountRegenerateKeyParameters

Parameters to regenerate the keys within the database account.

Name Type Description
keyKind

The access key to regenerate.

KeyKind

The access key to regenerate.

Name Type Description
primary
  • string
primaryReadonly
  • string
secondary
  • string
secondaryReadonly
  • string