{"id":10982,"date":"2025-10-22T11:26:18","date_gmt":"2025-10-22T18:26:18","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cosmosdb\/?p=10982"},"modified":"2025-11-11T22:59:50","modified_gmt":"2025-11-12T06:59:50","slug":"bringing-context-to-copilot-azure-cosmos-db-best-practices-right-in-your-vs-code-workspace","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/bringing-context-to-copilot-azure-cosmos-db-best-practices-right-in-your-vs-code-workspace\/","title":{"rendered":"Bringing Context to Copilot: Azure Cosmos DB Best Practices, Right in Your VS Code Workspace"},"content":{"rendered":"<p><!--ScriptorStartFragment--><\/p>\n<div class=\"scriptor-paragraph\">Developers love GitHub Copilot for its instant, intelligent code suggestions. But what if those suggestions could also reflect your specific database and workload patterns? That\u2019s now possible with a new feature in Azure Cosmos DB for VS Code.<\/div>\n<div><\/div>\n<div class=\"scriptor-paragraph\">Starting today, when you connect to your Cosmos DB account in VS Code, the extension automatically deploys an azurecosmosdb.instructions.md file to your user profile folder, ensuring it works seamlessly across all workspaces without requiring duplication in each project. This file acts as a context provider for GitHub Copilot a bridge that helps the AI understand your project\u2019s Cosmos DB context and surface relevant best practices, code patterns, and recommendations.<\/div>\n<p>&nbsp;<\/p>\n<div class=\"scriptor-paragraph\"><center><iframe title=\"Copilot, Meet Your Data: Azure Cosmos DB for VS Code #azurecosmosdb #vscode #ai\" src=\"https:\/\/www.youtube.com\/embed\/QdovrPXRH1w\" width=\"372\" height=\"662\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/center><\/p>\n<div><\/div>\n<div class=\"scriptor-paragraph\">The automatically deployed <code class=\"language-PlainText\">azurecosmosdb.instructions.md<\/code> file brings expert recommendations directly into your workspace, helping you make the right design and performance choices without leaving VS Code. It\u2019s your built-in playbook for Azure Cosmos DB always up to date, always contextual. And because it\u2019s open and extensible, we\u2019d love your input too! If you have best practices or recommendations that you believe others would benefit from, please feel free to raise a Pull Request on our <a href=\"https:\/\/github.com\/microsoft\/vscode-cosmosdb\"><span role=\"link\">GitHub repository<\/span><\/a> or provide feedback in the <a href=\"https:\/\/github.com\/microsoft\/vscode-cosmosdb\/issues\"><span role=\"link\">issues<\/span><\/a>. We<span role=\"link\"> welcome contributions from the community to make this guidance even better.<\/span><\/div>\n<h3>Context-Aware AI Made Simple<\/h3>\n<div class=\"scriptor-paragraph\">GitHub Copilot in VS Code now supports custom instructions, letting developers provide AI with project-specific context for smarter suggestions. Instead of manually crafting those instructions, the <a href=\"https:\/\/github.com\/Azure\/azure-cosmosdb-vscode\"><span role=\"link\">Azure Cosmos DB for VS Code\u00a0<\/span><\/a><span role=\"link\">extension automatically creates <\/span><code class=\"language-PlainText\">azurecosmosdb.instructions.md<\/code> file filled with Azure Cosmos DB specific best practices and recommendations. This means Copilot instantly understands your database context from partitioning and performance tuning to diagnostics making it easier for you to build and optimize applications without extra setup.<\/div>\n<p>&nbsp;<\/p>\n<h3>Why This Matters<\/h3>\n<div class=\"scriptor-paragraph\">AI coding assistants like Copilot are only as smart as the context they have. Without understanding how your app interacts with Azure Cosmos DB\u00a0 uch as partitioning, indexing, or query design. Copilot can generate suggestions that aren\u2019t optimized for your database setup.<\/div>\n<div><\/div>\n<div class=\"scriptor-paragraph\">By introducing the <code class=\"language-PlainText\">azurecosmosdb.instructions.md<\/code>, the extension ensures Copilot has immediate access to:<\/div>\n<ul class=\"\">\n<li class=\"scriptor-listItemlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb20\">Azure Cosmos DB best practices (e.g., partition key design, throughput management)<\/li>\n<li class=\"scriptor-listItemlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb20\">Performance tips for multi-partition queries<\/li>\n<li class=\"scriptor-listItemlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb20\">Diagnostic logging recommendations for troubleshooting latency or errors<\/li>\n<li class=\"scriptor-listItemlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb20\">Guidance on cost-efficient setups and vector search scenarios<\/li>\n<\/ul>\n<h3>How It Works<\/h3>\n<ol class=\"scriptor-listCounterlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb21 scriptor-listCounterResetlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb21\">\n<li class=\"scriptor-listItemlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb21\">Install or update the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-azuretools.vscode-cosmosdb\">Azure Cosmos DB VS Code Extension<\/a>.<\/li>\n<li class=\"scriptor-listItemlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb21\">Connect your account or open a workspace that uses Azure Cosmos DB.<\/li>\n<li class=\"scriptor-listItemlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb21\">The extension automatically adds an <code class=\"language-PlainText\">azurecosmosdb.instructions.md<\/code> file to your user profile prompt folder.<\/li>\n<li class=\"scriptor-listItemlist!list-19c55fac-2546-41df-82e1-e9d68adc9fb21\">GitHub Copilot then uses this context to offer smarter, scenario-aware suggestions as you write queries, SDK calls, or data models.<\/li>\n<\/ol>\n<h3>Developer Impact<\/h3>\n<div class=\"scriptor-paragraph\">This update turns the Azure Cosmos DB extension into more than just a management tool, it becomes an AI knowledge layer within your development environment.<\/div>\n<div><\/div>\n<div class=\"scriptor-paragraph\">With this, developers can:<\/div>\n<div><\/div>\n<div class=\"scriptor-paragraph\">\u2705 Write optimized queries and SDK calls guided by contextual best practices.<\/div>\n<div class=\"scriptor-paragraph\">\u2705 Avoid common pitfalls early in development.<\/div>\n<div class=\"scriptor-paragraph\">\u2705 Get Copilot suggestions aligned with real-world Azure Cosmos DB guidance, not generic database logic.<\/div>\n<h3>Try It Out<\/h3>\n<div class=\"scriptor-paragraph\">You can install or update the <a href=\"https:\/\/link%20this\/\"><span role=\"link\">Azure Cosmos DB for VS Code extension<\/span><\/a> today from the Visual Studio Marketplace<\/div>\n<div class=\"scriptor-paragraph\">Connect your Cosmos DB account, open your workspace, and let Copilot guide you \u2014 now with real Cosmos DB intelligence built in.<\/div>\n<h2>\u2b50Leave a review<\/h2>\n<div class=\"scriptor-paragraph\">Tell us about your Azure Cosmos DB experience! Leave a review on PeerSpot and we\u2019ll gift you $50. <a href=\"https:\/\/peerspotdotcom.my.site.com\/proReviews\/?SalesOpportunityProduct=00kPy000004TKXJIA4&amp;productPeerspotNumber=30881&amp;CalendlyAccount=peerspot&amp;CalendlyFormLink=peerspot-product-reviews-ps-gc-vi-sf-50&amp;giftCard=50\"><span role=\"link\">Get started here<\/span><\/a>.<\/div>\n<h2>\u2601\ufe0fAbout Azure Cosmos DB<\/h2>\n<div class=\"scriptor-paragraph\">Azure Cosmos DB is a fully managed and serverless NoSQL and vector database for modern app development, including AI applications. With its SLA-backed speed and availability as well as instant dynamic scalability, it is ideal for real-time NoSQL and MongoDB applications that require high performance and distributed computing over massive volumes of NoSQL and vector data.<\/div>\n<div class=\"scriptor-paragraph\"><a href=\"https:\/\/cosmos.azure.com\/try\/\"><span role=\"link\">Try Azure Cosmos DB for free here.<\/span><\/a> To stay in the loop on Azure Cosmos DB updates, follow us on <a href=\"https:\/\/twitter.com\/AzureCosmosDB\"><span role=\"link\">X<\/span><\/a>, <a href=\"https:\/\/aka.ms\/AzureCosmosDBYouTube\"><span role=\"link\">YouTube<\/span><\/a>, and <a href=\"https:\/\/www.linkedin.com\/company\/azure-cosmos-db\/\"><span role=\"link\">LinkedIn<\/span><\/a>.<\/div>\n<p><br class=\"scriptor-paragraph\" \/><br class=\"scriptor-paragraph\" \/><br class=\"scriptor-paragraph\" \/><br class=\"scriptor-paragraph\" \/><br class=\"scriptor-paragraph\" \/><br class=\"scriptor-paragraph\" \/><br class=\"scriptor-paragraph\" \/><br class=\"scriptor-paragraph\" \/><!--ScriptorEndFragment--><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Developers love GitHub Copilot for its instant, intelligent code suggestions. But what if those suggestions could also reflect your specific database and workload patterns? That\u2019s now possible with a new feature in Azure Cosmos DB for VS Code. Starting today, when you connect to your Cosmos DB account in VS Code, the extension automatically deploys [&hellip;]<\/p>\n","protected":false},"author":80443,"featured_media":10985,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,19],"tags":[1864,1960,1872,1954],"class_list":["post-10982","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-core-sql-api","category-tips-and-tricks","tag-azurecosmosdb","tag-copilot","tag-nosql","tag-vscode"],"acf":[],"blog_post_summary":"<p>Developers love GitHub Copilot for its instant, intelligent code suggestions. But what if those suggestions could also reflect your specific database and workload patterns? That\u2019s now possible with a new feature in Azure Cosmos DB for VS Code. Starting today, when you connect to your Cosmos DB account in VS Code, the extension automatically deploys [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/10982","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\/80443"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=10982"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/10982\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/10985"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=10982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=10982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=10982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}