Microsoft Copilot for Azure enables natural language queries for Azure Cosmos DB data

Meredith Moore

James Codella

We are thrilled to announce Microsoft Copilot for Azure in Azure Cosmos DB is now in public preview! Microsoft Copilot for Azure is an AI companion that simplifies how you design, operate, optimize, and troubleshoot from cloud to edge. Copilot’s integration into Azure Cosmos DB is an amazing AI-powered capability that can create Azure Cosmos DB NoSQL queries based on your natural language questions about your data!

With Copilot, you don’t have to worry about the syntax or the structure of your NoSQL queries. Just type in your English-language question about your data and items in your Azure Cosmos DB collection, and Copilot will generate a query suggestion for you. Every generated query suggestion also contains a natural language explanation of the query, which can help you to understand and validate the query generated by Copilot. This empowers you to quickly and easily access your data stored in Azure Cosmos DB, and also learn how to write NoSQL queries better.

As a preview feature, you’ll have to add Microsoft copilot for Azure in Cosmos DB preview to your Azure subscription. Learn more about preview features here. Once enrolled, you can find Microsoft Copilot for Azure integrated with the Data Explorer’s query editor. Just click on the Copilot icon and start asking questions about your data. Copilot will enter query suggestions into the query editor pane where you can also copy, edit, or execute them. Try it out today and see how Copilot can help you write NoSQL queries faster and easier!

Getting Started

To use Copilot to write NoSQL queries faster and easier, you can follow these steps:

0. Enroll your Azure subscription in the Microsoft Copilot for Azure in Cosmos DB preview feature.

1. Open the Azure portal and navigate to your Azure Cosmos DB NoSQL resource.

2. Navigate to the Data Explorer query editor within the NoSQL API.

3. Select the database and collection you’d like to query:

      1. You can select any of your databases and collections that you have access to in the MY DATA section of the left-hand navigation pane. Once the collection is chosen, you can right-click select New SQL Query or select New SQL Query in the toolbar.

Getting started with Microsoft copilot for azure in Cosmos DB

b. Or you can choose the sample database CopilotSampleDb from the SAMPLE DATA to use a pre-populated collection. This can also be accessed quickly by selecting the “Query faster with Copilot” card.

Data Explorer home page highlighting the card for Copilot

4. Type a clear and concise question about the data you are looking for in the prompt box. Use keywords and context that are relevant to the Azure Cosmos DB document structure. Specify properties and any filtering criteria as explicitly as possible. Avoid ambiguous or overly complex language in your prompts.

5. Click on the Generate Query button to see the suggested NoSQL query based on your prompt. You can also see the AI explanations of how the query works below the suggestion.

Microsoft copilot for Azure Cosmos DB query execution

6. All Copilot generated queries should be reviewed and verified before executing them. If you are satisfied with the suggested query, you can copy it to the clipboard or execute it directly in the query editor. You can also modify the query as you wish before executing it or refine your existing prompt, for more guidance see the FAQ.

7. You can also provide feedback to the Copilot team by clicking on the thumbs up or thumbs down icons next to the suggestion. This will help inform the product team where the Copilot is performing well, and where there are opportunities for improvement.

Microsoft copilot for Azure Cosmos DB feedback form

That’s how you can use Copilot to query your data using natural language and learn how to write queries faster. Microsoft Copilot for Azure is an AI companion that unlocks the full power of Azure. We hope that Copilot will make your data querying experience more enjoyable and productive.

Learn how to sign up for Microsoft Copilot for Azure preview

Learn how to use the preview of Microsoft Copilot for Azure to write Azure Cosmos DB NoSQL queries

Transparency FAQ

Learn more about Microsoft Copilot for Azure

About Azure Cosmos DB

Azure Cosmos DB is a fully managed and serverless distributed database for modern app development, with SLA-backed speed and availability, automatic and instant scalability, and support for open-source PostgreSQL, MongoDB, and Apache Cassandra. Try Azure Cosmos DB for free here. To stay in the loop on Azure Cosmos DB updates, follow us on TwitterYouTube, and LinkedIn.


Discussion is closed.

Feedback usabilla icon