{"id":7110,"date":"2023-11-15T08:00:16","date_gmt":"2023-11-15T16:00:16","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=7110"},"modified":"2024-01-23T12:20:44","modified_gmt":"2024-01-23T20:20:44","slug":"microsoftcopilotforazureincdb","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/microsoftcopilotforazureincdb\/","title":{"rendered":"Microsoft Copilot for Azure enables natural language queries for Azure Cosmos DB data"},"content":{"rendered":"<p>We are thrilled to announce Microsoft Copilot for Azure in Azure Cosmos DB is now in public preview! <a href=\"https:\/\/aka.ms\/MSCopilotforAzurePreview\">Microsoft Copilot for Azure<\/a>\u00a0is an AI companion that simplifies how you design, operate, optimize, and troubleshoot from cloud to edge. Copilot\u2019s 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!<\/p>\n<p>With Copilot, you don&#8217;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.<\/p>\n<p>As a preview feature, you&#8217;ll have to add Microsoft copilot for Azure in Cosmos DB preview to your Azure subscription. <a href=\"https:\/\/learn.microsoft.com\/azure\/azure-resource-manager\/management\/preview-features?tabs=azure-portal\">Learn more about preview features here<\/a>. Once enrolled, you can find Microsoft Copilot for Azure integrated with the Data Explorer\u2019s 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!<\/p>\n<h2>Getting Started<\/h2>\n<p>To use Copilot to write NoSQL queries faster and easier, you can follow these steps:<\/p>\n<p style=\"padding-left: 40px;\">0. Enroll your Azure subscription in the Microsoft Copilot for Azure in Cosmos DB <a href=\"https:\/\/learn.microsoft.com\/azure\/azure-resource-manager\/management\/preview-features?tabs=azure-portal\">preview feature<\/a>.<\/p>\n<p style=\"padding-left: 40px;\">1. Open the Azure portal and navigate to your Azure Cosmos DB NoSQL resource.<\/p>\n<p style=\"padding-left: 40px;\">2. Navigate to the Data Explorer query editor within the NoSQL API.<\/p>\n<p style=\"padding-left: 40px;\">3. Select the database and collection you\u2019d like to query:<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol style=\"list-style-type: lower-alpha;\">\n<li>You can select any of your databases and collections that you have access to in the <em>MY DATA<\/em> section of the left-hand navigation pane. Once the collection is chosen, you can right-click select <em>New SQL Query <\/em>or select<em> New SQL Query <\/em>in the toolbar.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-1a-scaled.jpg\"><img decoding=\"async\" class=\"size-large wp-image-7131 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-1a-1024x489.jpg\" alt=\"Getting started with Microsoft copilot for azure in Cosmos DB\" width=\"640\" height=\"306\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-1a-1024x489.jpg 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-1a-300x143.jpg 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-1a-768x366.jpg 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-1a-1536x733.jpg 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-1a-2048x977.jpg 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p style=\"padding-left: 80px;\">b. Or you can choose the sample database<em> CopilotSampleDb<\/em> from the <em>SAMPLE DATA <\/em>to use a pre-populated collection. This can also be accessed quickly by selecting the \u201cQuery faster with Copilot\u201d card.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-2-scaled.jpg\"><img decoding=\"async\" class=\"size-large wp-image-7132 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-2-1024x504.jpg\" alt=\"Data Explorer home page highlighting the card for Copilot\" width=\"640\" height=\"315\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-2-1024x504.jpg 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-2-300x148.jpg 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-2-768x378.jpg 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-2-1536x755.jpg 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-2-2048x1007.jpg 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p style=\"padding-left: 40px;\">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.<\/p>\n<p style=\"padding-left: 40px;\">5. Click on the <em>Generate Query<\/em> 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.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-3-scaled.jpg\"><img decoding=\"async\" class=\"size-large wp-image-7133 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-3-1024x367.jpg\" alt=\"Microsoft copilot for Azure Cosmos DB query execution\" width=\"640\" height=\"229\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-3-1024x367.jpg 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-3-300x107.jpg 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-3-768x275.jpg 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-3-1536x550.jpg 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-3-2048x733.jpg 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p style=\"padding-left: 40px;\">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 <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/cosmos-db\/copilot-faq\">FAQ<\/a>.<\/p>\n<p style=\"padding-left: 40px;\">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.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-4-scaled.jpg\"><img decoding=\"async\" class=\"alignnone size-large wp-image-7134\" src=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-4-1024x463.jpg\" alt=\"Microsoft copilot for Azure Cosmos DB feedback form \" width=\"640\" height=\"289\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-4-1024x463.jpg 1024w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-4-300x136.jpg 300w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-4-768x347.jpg 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-4-1536x695.jpg 1536w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2023\/11\/getting-started-copilot-4-2048x927.jpg 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>That\u2019s 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.<\/p>\n<h2>Related Links<\/h2>\n<p><a href=\"https:\/\/aka.ms\/MSCopilotforAzurePreview\">Learn how to sign up for Microsoft Copilot for Azure preview<\/a><\/p>\n<p><a href=\"https:\/\/aka.ms\/MicrosoftCopilotForAzureInCDBHowTo\">Learn how to use the preview of Microsoft Copilot for Azure to write Azure Cosmos DB NoSQL queries<\/a><\/p>\n<p><a href=\"https:\/\/aka.ms\/MicrosoftCopilotForAzureInCDBFAQ\">Transparency FAQ<\/a><\/p>\n<p><a href=\"https:\/\/aka.ms\/MicrosoftCopilotForAzureDocs\">Learn more about Microsoft Copilot for Azure<\/a><\/p>\n<h2>About Azure Cosmos DB<\/h2>\n<p>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.\u00a0<a href=\"https:\/\/cosmos.azure.com\/try\/\" target=\"_blank\" rel=\"noopener\">Try Azure Cosmos DB for free here.<\/a>\u00a0To stay in the loop on Azure Cosmos DB updates, follow us on\u00a0<a href=\"https:\/\/twitter.com\/AzureCosmosDB\" target=\"_blank\" rel=\"noopener\">Twitter<\/a>,\u00a0<a href=\"https:\/\/www.youtube.com\/AzureCosmosDB\" target=\"_blank\" rel=\"noopener\">YouTube<\/a>, and\u00a0<a href=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\" target=\"_blank\" rel=\"noopener\">LinkedIn<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are thrilled to announce Microsoft Copilot for Azure in Azure Cosmos DB is now in public preview! Microsoft Copilot for Azure\u00a0is an AI companion that simplifies how you design, operate, optimize, and troubleshoot from cloud to edge. Copilot\u2019s integration into Azure Cosmos DB is an amazing AI-powered capability that can create Azure Cosmos DB [&hellip;]<\/p>\n","protected":false},"author":133447,"featured_media":7133,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[],"class_list":["post-7110","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-sql-api"],"acf":[],"blog_post_summary":"<p>We are thrilled to announce Microsoft Copilot for Azure in Azure Cosmos DB is now in public preview! Microsoft Copilot for Azure\u00a0is an AI companion that simplifies how you design, operate, optimize, and troubleshoot from cloud to edge. Copilot\u2019s integration into Azure Cosmos DB is an amazing AI-powered capability that can create Azure Cosmos DB [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/7110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/133447"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=7110"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/7110\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/7133"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=7110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=7110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=7110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}