In this article

Work with data using Azure Storage Explorer

In this article

Using Azure Cosmos DB in Azure Storage Explorer enables users to manage Azure Cosmos DB entities, manipulate data, update stored procedures and triggers along with other Azure entities like Storage blobs and queues. Now you can use the same tool to manage your different Azure entities in one place. At this time, Azure Storage Explorer supports Cosmos accounts configured for SQL, MongoDB, Graph, and Table APIs.

Installation

Connect to an Azure subscription

After installing the Azure Storage Explorer, click the plug-in icon on the left as shown in the following image:

Select Add an Azure Account, and then click Sign-in.

In the Azure Sign in dialog box, select Sign in, and then enter your Azure credentials.

Select your subscription from the list and then click Apply.

The Explorer pane updates and displays the accounts in the selected subscription.

You have successfully connected to your Cosmos DB account to your Azure subscription.

Connect to Azure Cosmos DB by using a connection string

An alternative way of connecting to an Azure Cosmos DB is to use a connection string. Use the following steps to connect using a connection string.

Find Local and Attached in the left tree, right-click Cosmos DB Accounts, choose Connect to Cosmos DB...

Only support SQL and Table API currently. Choose API, paste Connection String, input Account label, click Next to check the summary, and then click Connect to connect Azure Cosmos DB account. For information on retrieving the connection string, see Get the connection string.

Connect to Azure Cosmos DB by using local emulator

Use the following steps to connect to an Azure Cosmos DB by Emulator, only support SQL account currently.

Find Local and Attached in the left tree, right-click Cosmos DB Accounts, choose Connect to Cosmos DB Emulator...

Only support SQL API currently. Paste Connection String, input Account label, click Next to check the summary, and then click Connect to connect Azure Cosmos DB account. For information on retrieving the connection string, see Get the connection string.

Azure Cosmos DB resource management

You can manage an Azure Cosmos DB account by doing following operations:

Open the account in the Azure portal

Add the resource to the Quick Access list

Search and refresh resources

Create and delete databases

Create and delete collections

Create, edit, delete, and filter documents

Manage stored procedures, triggers, and user-defined functions

Quick access tasks

By right-clicking on a subscription in the Explorer pane, you can perform many quick action tasks:

Right-click an Azure Cosmos DB account or a database, you can choose Open in Portal and manage the resource in the browser on the Azure portal.

You can also add Azure Cosmos DB account, database, collection to Quick Access.

Create a collection

Select Unlimited to be able to specify partition key, then click OK to finish.

If a partition key is used when creating a collection, once creation is completed, the partition key value can't be changed on the collection.

Delete a collection

Right-click the collection, click Delete Collection, and then click Yes in the pop-up window.

The collection node is deleted, and the database refreshes automatically.

Document management

Create and modify documents

To create a new document, open Documents in the left window, click New Document, edit the contents in the right pane, then click Save. You can also update an existing document, and then click Save. Changes can be discarded by clicking Discard.

Delete a document

Click the Delete button to delete the selected document.

Query for documents

Edit the document filter by entering a SQL query and then click Apply.

Graph management

Create and modify vertex

To create a new vertex, open Graph from the left window, click New Vertex, edit the contents, then click OK.

To modify an existing vertex, click the pen icon in the right pane.

Delete a graph

To delete a vertex, click the recycle bin icon beside the vertex name.

Filter for graph

Edit the graph filter by entering a gremlin query and then click Apply Filter.

Table management

Create and modify table

To create a new table, open Entities from the left window, click Add, edit the content in Add Entity dialog, add property by clicking button Add Property, then click Insert.

To modify a table, click Edit, modify the content, then click Update.

Import and export table

To import, click Import button and choose an existing table.

To export, click Export button and choose a destination.

Delete entities

Select the entities and click button Delete.

Query table

Manage stored procedures, triggers, and UDFs

To create a stored procedure, in the left tree, right-click Stored Procedure, choose Create Stored Procedure, enter a name in the left, type the stored procedure scripts in the right window, and then click Create.

You can also edit existing stored procedures by double-clicking, making the update, and then clicking Update to save, or click Discard to cancel the change.

The operations for Triggers and UDF are similar with Stored Procedures.

Troubleshooting

Azure Cosmos DB in Azure Storage Explorer is a standalone app that allows you to connect to Azure Cosmos DB accounts hosted on Azure and Sovereign Clouds from Windows, macOS, or Linux. It enables you to manage Azure Cosmos DB entities, manipulate data, update stored procedures and triggers along with other Azure entities like Storage blobs and queues.

These are solutions for common issues seen for Azure Cosmos DB in Storage Explorer.

Sign in issues

Before proceeding further, try restarting your application and see if the problems can be fixed.

Self-signed certificate in certificate chain

There are a few reasons you may be seeing this error, the two most common ones are:

You're behind a transparent proxy, which means someone (such as your IT department) is intercepting HTTPS traffic, decrypting it, and then encrypting it using a self-signed certificate.

You're running software, such as anti-virus software, which is injecting a self-signed SSL certificates into the HTTPS messages you receive.

When Storage Explorer encounters one of these "self-signed certificates", it can no longer know if the HTTPS message it's receiving has been tampered with. If you have a copy of the self-signed certificate though, then you can tell Storage Explorer to trust it. If you're unsure of who is injecting the certificate, then you can try to find it yourself by doing the following steps:

You will have to reenter all your credentials if you delete these files

Http/Https proxy issue

You cannot list Azure Cosmos DB nodes in left tree when configuring http/https proxy in ASE. It's a known issue, and will be fixed in next release. You could use Azure Cosmos DB data explorer in Azure portal as a work-around at this moment.

"Development" node under "Local and Attached" node issue

There is no response after clicking the "Development" node under "Local and Attached" node in left tree. The behavior is expected. Azure Cosmos DB local emulator will be supported in next release.

Attaching Azure Cosmos DB account in "Local and Attached" node error

If you see below error after attaching Azure Cosmos DB account in "Local and Attached" node, then check if you're using the right connection string.

Expand Azure Cosmos DB node error

You may see below error while trying to expand the tree nodes in left.

Try the following suggestions:

Check if the Azure Cosmos DB account is in provision progress and try again when the account is being created successfully.

If the account is under "Quick Access" node or "Local and Attached" nodes, then check if the account has been deleted. If so, you need to remove the node manually.

Contact us

If none of the solutions work for you, send email to Azure Cosmos DB Dev Tooling Team (cosmosdbtooling@microsoft.com) with details about the issue, for fixing the issues.