What are Connection Strings?
Connection strings are strings that contain the connection information needed to connect to your Azure Cosmos DB account. They include the account key, database name, and container name.
Connection String Format
The general format of a Cosmos DB connection string is:
AccountEndpoint=accountendpoint;AccountKey=accountkey;Database=database;Container=container
- AccountEndpoint: The fully qualified domain name (FQDN) of your Cosmos DB account.
- AccountKey: Your Cosmos DB account key.
- Database: The name of the database you want to access.
- Container: The name of the container within the database you want to access.
Example
Here's an example connection string:
AccountEndpoint=https://youraccount.documents.azure.com:443/;AccountKey=youraccountkey;Database=myDatabase;Container=myContainer
Important: Replace youraccount and youraccountkey with your actual Cosmos DB account details.