Wednesday, August 24, 2022

Connecting to Azure Cosmos DB API for MongoDB using Azure Data Studio

Did you know that we can connect to an Azure Cosmos DB API for MongoDB using Azure Data Studio. There is an extension: Azure Cosmos DB API for MongoDB for Azure Data Studio, it's still in it's preview stage, but works great.

This extension in Azure Data Studio includes features such as,

  • Connection manager & query editor
  • Provisioning and scaling containers
  • Integrated terminal

Let's have a look at how easy it is to use this extension.

First, you need to download and install Azure Data Studio (if you haven't already). Then search for mongo under extensions. 
Install Azure Cosmos DB API for MongoDB extension
Select Azure Cosmos DB API for MongoDB, install it and then reload/restart the Azure Data Studio. Once that's done, click on New Connection and select Mongo account as the Connection Type.
Connect to MongoDB account
Now copy and paste the Connection string of your Azure Cosmos DB API for MongoDB account and click on Connect. Once you are connected. you will see all your databases.
Connected to Azure Cosmos DB API for MongoDB account
You can right-click on the connected account and select Manage to see more options. 
Manage Mongo account
Here I am opening an existing database and going to Open Mongo Shell to run a simple query on that database.
Executing queries on Mongo Shell
Do try it out, you are going to love it.

Happy Coding.

Regards,
Jaliya

No comments:

Post a Comment