Connecting Azure Cosmos DB with Azure Storage Explorer by using Connection String

Connecting Azure Cosmos DB with Azure Storage Explorer by using Connection String

In the previous post (Working with Azure Storage Explorer for Azure Cosmos DB ), we have discussed how we can use Azure Storage Explorer to connect and manage Azure Cosmos DB. Apart from connecting with Azure Cosmos DB using Azure Subscription, you can directly connect with Cosmos DB using the connection string. This is an alternative way of connecting to Azure Cosmos DB, and in this case, you don’t load all other Azure resources under your subscription. Just connect with what you need.

Use following steps to connect Azure Cosmos DB and Azure Storage Explorer using a connection string.

Obtain the Connection String

From the Azure Portal, Navigate to the respective Cosmos DB Resource, and from the left side panel SettingsConnection String Copy the Primary Connection String.

Obtaining Connection String for Azure Cosmos DB
Obtaining Connection String for Azure Cosmos DB

 

Connect Azure Storage Explore with Cosmos DB

From the Azure Storage Explorer left the tree, navigate to Local and AttachedAzure Cosmos DB Accounts, and right click on to it. choose Connect to Azure Cosmos DB.

 

Connect to Azure Cosmos DB
Connect to Azure Cosmos DB

Select the respective API for the Database (In this case I have MongoDB), and update the copied Connection String obtained from the Azure Portal.

Connect with Azure Cosmos DB API
Connect with Azure Cosmos DB API

Click on OK – It will pull all the related Databases, Sorted Procedure, Triggers etc. from your Azure Cosmos DB Account.

Explore Azure Cosmos DB
Explore Azure Cosmos DB

 

Detach the Cosmos DB from Storage Explorer

If you have multiple Cosmos DB Connected, or you want to disconnect any specific Cosmos DB,  you can right-click on the respective account and Detach it from the Azure Storage Explorer.

Detach Cosmos DB From Storage Explorer
Detach Cosmos DB From Storage Explorer

With this, you can connect and work with Azure Cosmos DB using Azure Storage Explorer without attaching any other resources from your subscription.

Hope this helps.

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

2 Comments to “Connecting Azure Cosmos DB with Azure Storage Explorer by using Connection String”

Comments are closed.