Microsoft Copilot for Azure enables natural language queries for Azure Cosmos DB data
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.
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!
As preview capability, Microsoft Copilot for Azure in Azure Cosmos DB needs to be enabled by your Azure subscription’s administrator in the Subscription’s preview features control as shown below. Learn how to setup preview features in an Azure subscription here.
Once your subscription has Copilot to write NoSQL queries faster and easier, you can follow these steps:
1. Open the Azure portal and navigate to your Azure Cosmos DB NoSQL resource.
2. Navigate to the features blade under Settings and enable Copilot.
3. Navigate to the Data Explorer query editor within the NoSQL API.
4. Select the database and collection you’d like to query:
- 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.
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.
5. After enrolling in the preview feature, Copilot should be automatically enabled in the query editor. If not, click the “Enable Copilot” button in the menu bar above the query editor to get started.
6. 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.
7. 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.
8. 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.
9. 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.
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.
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 Twitter, YouTube, and LinkedIn.