Azure Cosmos DB is a fully managed, multi-model database service. A multi-model database is a database that supports multiple APIs and multiple data models. Different APIs use different data formats for storage. Cosmos DB uses a SQL API by default but implements wire protocol for MongoDB, Gremlin, Cassandra, and Azure Table Storage. So, using these APIs, any compatible application can connect to Cosmos DB through its drivers, with the benefit of Cosmos DB’s core features.
On the other hand, MongoDB is an open-source document database whose documents are like JSON objects. Azure Cosmos DB implements the same wire protocol as MongoDB. We can query Cosmos DB using MongoDB client libraries. In this blog, let’s see how to connect to Azure Cosmos DB using the Bold BI’s MongoDB data connection.
To connect to Cosmos DB using the MongoDB connector, an Azure Cosmos DB account should be created with the API type of MongoDB from the Azure Portal.
- As of writing, Cosmos DB has a limitation. The type of API cannot be changed after the Cosmos DB account is created, so we either need to create a new account for a different API type or migrate data into a new database account from an older database account. Data migration steps are provided for each API type for MongoDB.
- The Azure Cosmos DB’s API for MongoDB is compatible with MongoDB server version 3.2 and 3.6. There are some limitations in query language explained in this documentation.
Connecting to Cosmos DB from Bold BI
Bold BI has support to connect to the MongoDB database using the MongoDB connector. As the MongoDB connector uses the MongoDB client library to access the MongoDB database, we can connect to Azure Cosmos DB in Bold BI using the same MongoDB data source connector:
- To start with, sign in to your Azure portal account and open your Cosmos DB account.
- In the left pane of the account blade, click Connection String. It has all the information necessary to connect to Bold BI using the MongoDB data source, so make note of the host, port, SSL, username, and password.
- Open the Bold BI application and navigate to the Data Sources tab in the left pane.
- Search for and select the MongoDB connector.
- In MongoDB, create a data source dialog and enter a valid name for the data source.
- Set the authentication type as SCRAM and enable SSL (if SSL is true in Cosmos DB).
- In the Server name field, enter the host value of Cosmos DB, noted from the Azure portal.
- Similarly, enter the port, username, and password.
- Click on the Database drop-down. It will list all databases in Cosmos DB.
- Select one and click Connect. It will list all the tables in MongoDB along with preview data.
- Select the required tables and click Connect to extract the required tables into Bold BI.
- Once all selected tables are extracted successfully into Bold BI, start designing business dashboards for data in Azure Cosmos DB.
If you have any questions, please post them in the comments section below. You can also contact us by submitting your questions through the Bold BI website or, if you already have an account, you can log in to submit your support question. Bold BI dashboards now come with a 15-day free trial with no credit card information required. We welcome you to start a free trial and experience Bold BI for yourself.