Skip to main content

Add Cosmos DB Resource

This guide will walkthrough adding a Cosmos DB resource to Meroxa. Before adding, see Cosmos DB Setup.

Credentials

To add a Cosmos DB resource, you will need an Access URL:

The Access URL contains the credentials needed to access your instance:

cosmosdb://$COSMOS_ACCOUNT_NAME:$COSMOS_PRIMARY_KEY@$COSMOS_ACCOUNT_NAME.documents.azure.com:443/$COSMOS_DATABASE

In the example above, replace following variables with valid credentials from your Cosmos DB environment:

  • $COSMOS_ACCOUNT_NAME - Cosmos DB Account Name
  • $COSMOS_PRIMARY_KEY - Cosmos DB Primary Key
  • $COSMOS_DATABASE - Cosmos DB Database Name

Adding Resource

Using the CLI, you can run the following command to add a new resource:

meroxa resource add my-cosmosdb \
--type cosmosdb \
--url cosmosdb://$COSMOS_ACCOUNT_NAME:$COSMOS_PRIMARY_KEY@$COSMOS_ACCOUNT_NAME.documents.azure.com:443/$COSMOS_DATABASE \

In the command above, replace the following variables with valid credentials from your Cosmos DB environment.

You can view your resource with meroxa resource ls or in the Dashboard.