October 22nd, 2025
0 reactions

Bringing Context to Copilot: Azure Cosmos DB Best Practices, Right in Your VS Code Workspace

Sajeetharan Sinnathurai
Principal Program Manager

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’s 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 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’s Cosmos DB context and surface relevant best practices, code patterns, and recommendations.

 

The automatically deployed azurecosmosdb.instructions.md file brings expert recommendations directly into your workspace, helping you make the right design and performance choices without leaving VS Code. It’s your built-in playbook for Azure Cosmos DB always up to date, always contextual. And because it’s open and extensible, we’d 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 GitHub repository or provide feedback in the issues. We welcome contributions from the community to make this guidance even better.

Context-Aware AI Made Simple

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 Azure Cosmos DB for VS Code extension automatically creates azurecosmosdb.instructions.md 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.

 

Why This Matters

AI coding assistants like Copilot are only as smart as the context they have. Without understanding how your app interacts with Azure Cosmos DB  uch as partitioning, indexing, or query design. Copilot can generate suggestions that aren’t optimized for your database setup.
By introducing the azurecosmosdb.instructions.md, the extension ensures Copilot has immediate access to:
  • Azure Cosmos DB best practices (e.g., partition key design, throughput management)
  • Performance tips for multi-partition queries
  • Diagnostic logging recommendations for troubleshooting latency or errors
  • Guidance on cost-efficient setups and vector search scenarios

How It Works

  1. Install or update the Azure Cosmos DB VS Code Extension.
  2. Connect your account or open a workspace that uses Azure Cosmos DB.
  3. The extension automatically adds an azurecosmosdb.instructions.md file to your user profile prompt folder.
  4. GitHub Copilot then uses this context to offer smarter, scenario-aware suggestions as you write queries, SDK calls, or data models.

Developer Impact

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.
With this, developers can:
✅ Write optimized queries and SDK calls guided by contextual best practices.
✅ Avoid common pitfalls early in development.
✅ Get Copilot suggestions aligned with real-world Azure Cosmos DB guidance, not generic database logic.

Try It Out

You can install or update the Azure Cosmos DB for VS Code extension today from the Visual Studio Marketplace
Connect your Cosmos DB account, open your workspace, and let Copilot guide you — now with real Cosmos DB intelligence built in.

⭐Leave a review

Tell us about your Azure Cosmos DB experience! Leave a review on PeerSpot and we’ll gift you $50. Get started here.

☁️About Azure Cosmos DB

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.
Try Azure Cosmos DB for free here. To stay in the loop on Azure Cosmos DB updates, follow us on X, YouTube, and LinkedIn.









Author

Sajeetharan Sinnathurai
Principal Program Manager

Principal Product Manager passionate about empowering developers with exceptional tools and experiences. Currently part of the Azure Cosmos DB team, driving developer-focused features like JavaScript SDK, integrations, and tooling for local development etc. Interested in web development or cloud? Let’s connect!

0 comments