Database Accounts - List Connection Strings
Lists the connection strings for the specified Azure Cosmos DB database account.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings?api-version=2025-04-15
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
account
|
path | True |
string minLength: 3maxLength: 50 pattern: ^[a-z0-9]+(-[a-z0-9]+)* |
Cosmos DB database account name. |
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
subscription
|
path | True |
string minLength: 1 |
The ID of the target subscription. |
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
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
Cosmos |
Cosmos |
CosmosDBDatabaseAccountListConnectionStrings
Sample request
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/listConnectionStrings?api-version=2025-04-15
Sample response
{
"connectionStrings": [
{
"connectionString": "connection-string",
"description": "Primary SQL Connection String",
"keyKind": "Primary",
"type": "Sql"
}
]
}
CosmosDBDatabaseAccountListConnectionStringsMongo
Sample request
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/mongo-ddb1/listConnectionStrings?api-version=2025-04-15
Sample response
{
"connectionStrings": [
{
"connectionString": "connection-string",
"description": "Name of the connection string"
}
]
}
Definitions
Name | Description |
---|---|
Database |
Connection string for the Cosmos DB account |
Database |
The connection strings for the given database account. |
Kind |
Kind of the connection string key |
Type |
Type of the connection string |
DatabaseAccountConnectionString
Connection string for the Cosmos DB account
Name | Type | Description |
---|---|---|
connectionString |
string |
Value of the connection string |
description |
string |
Description of the connection string |
keyKind |
Kind of the connection string key |
|
type |
Type of the connection string |
DatabaseAccountListConnectionStringsResult
The connection strings for the given database account.
Name | Type | Description |
---|---|---|
connectionStrings |
An array that contains the connection strings for the Cosmos DB account. |
Kind
Kind of the connection string key
Value | Description |
---|---|
Primary | |
Secondary | |
PrimaryReadonly | |
SecondaryReadonly |
Type
Type of the connection string
Value | Description |
---|---|
Sql | |
Table | |
MongoDB | |
Cassandra | |
CassandraConnectorMetadata | |
Gremlin | |
SqlDedicatedGateway | |
GremlinV2 | |
Undefined |