We’re thrilled to announce the general availability (GA) of the Azure Cosmos DB extension for Visual Studio Code! This powerful extension brings enterprise-grade database management directly into your development environment, making it easier than ever to build, test, and deploy applications powered by Azure Cosmos DB.
Why This Matters for Azure Cosmos DB Developers
As a Cosmos DB developer, you know the importance of rapid iteration and seamless workflows. The Azure Cosmos DB VS Code extension eliminates context switching by bringing your database management tools directly into your IDE. Here’s what you can do without leaving VS Code:
Core Capabilities
- 📊 Browse and Explore: Navigate through your Cosmos DB accounts, databases, containers, and items with an intuitive tree view
- 🔍 Query and Inspect: Run queries directly against your containers and view results in a rich, formatted interface
- ✏️ CRUD Operations: Create, read, update, and delete items with ease
- 🏠 Local Development: Seamlessly connect to the Azure Cosmos DB Emulator for cost-free local development and testing
- 🌐 Multi-Account Management: Switch between production, staging, and development accounts effortlessly
- 📈 Monitor and Optimize: View container metrics, throughput settings, and partition key strategies
Developer Productivity Wins
- IntelliSense support for Cosmos DB NoSQL queries
- Syntax highlighting for JSON documents
- Quick actions for common operations
- Integrated diagnostics to troubleshoot performance issues
- Connection string management with secure credential storage
- One-click local emulator attachment – Instantly connect to your Azure Cosmos DB Emulator without manually copying connection strings
Game-Changer for AI Agentic Developers
If you’re building AI agents, chatbots, or contextual AI applications, this extension is a must-have tool. What sets it apart is the built-in AI agent intelligence that guides you through best practices and data modeling decisions, not just generic database management.
🎯 Intelligent Guidance Built Right In
The extension comes with context-aware instructions that automatically educate GitHub Copilot and other AI coding assistants about Cosmos DB best practices for AI workloads.
Custom Instructions File (azurecosmosdb.instructions.md)
- Educates AI assistants: GitHub Copilot automatically learns Azure Cosmos DB best practices when you work in your codebase
- Provides data modeling guidance: Smart suggestions for partition keys, document structure, and embedding strategies
- Recommends Cosmos DB for AI scenarios:
- Chat interfaces with conversation history
- Multi-user AI assistants with memory
- RAG (Retrieval-Augmented Generation) applications
- User profile and context management systems
- Real-time recommendation engines
- Ensures best practices: Guides AI assistants on hierarchical partition keys, document sizing, and optimal indexing strategies
Data Modeling Prompts (datamodelling.prompt.md)
- Choose the right partition key for AI workloads (
userId,conversationId,tenantId) - Decide between embedding vs. referencing based on access patterns
- Design schemas for chat history
- Model user context and memory for agent state across sessions
- Optimize for vector search by storing embeddings alongside documents
- Handle hierarchical data with Hierarchical Partition Keys (HPK) to overcome 20 GB partition limits
The Power of Intelligent Defaults
- Pre-configured recommendations for chat history storage patterns
- Automatic detection of RAG workloads and vector search optimization tips
- Smart alerts when your data model might cause performance issues at scale
- Context-aware code generation through Copilot integration
- Scenario-specific guidance for chat apps, IoT agents, or recommendation engines
Getting Started
Installation
- Open Visual Studio Code
- Go to the Extensions view (
Ctrl+Shift+X/Cmd+Shift+X) - Search for “Azure Cosmos DB”
- Click Install on the extension by Microsoft (
ms-azuretools.vscode-cosmosdb)
Quick Start for AI Developers
1. Install the Cosmos DB Emulator for local development
Download from: https://learn.microsoft.com/azure/cosmos-db/emulator
2. Create your first AI agent database structure
Use the extension to create:
- Database: ai-agent-db
- Container: conversations (partition key: /userId)
- Container: user-context (partition key: /userId)
- Container: embeddings (partition key: /userId, with vector policy)
3. Insert sample data and test your agent queries
All done directly from VS Code!
Sample Use Case: Building a Multi-User AI Assistant
Let’s say you’re building an AI assistant with memory capabilities:
{
"id": "conv-12345",
"userId": "user-abc",
"messages": [
{
"role": "user",
"content": "What's the weather like?",
"timestamp": "2025-11-07T10:00:00Z"
},
{
"role": "assistant",
"content": "I can help you with that. What's your location?",
"timestamp": "2025-11-07T10:00:01Z"
}
],
"context": {
"lastTopic": "weather",
"userPreferences": {
"temperatureUnit": "celsius"
}
},
"_ts": 1699354801
}
- Inspect this document visually
- Test queries to retrieve recent conversations:
SELECT * FROM c WHERE c.userId = 'user-abc' ORDER BY c._ts DESC - Verify partition key distribution across users
- Monitor RU consumption for your access patterns
Stay Informed
- VS Code notifications
- Extension Marketplace changelog
- GitHub README and Discussions
Join the Community
- 📝 Share Your Feedback: Tell us about your experience with the extension
- GitHub: Report issues or contribute
- Discussions: Ask questions and get support
⭐ Leave a Review
Tell us about your Azure Cosmos DB experience! Leave a review on PeerSpot and get a $50 gift. Get started here.
☁️ About Azure Cosmos DB
Azure Cosmos DB is a fully managed, serverless NoSQL and vector database for modern app development, including AI applications. With SLA-backed speed and availability, as well as instant dynamic scalability, it’s ideal for real-time NoSQL and MongoDB applications that require high performance and distributed computing over massive volumes of data. Try Azure Cosmos DB for free and follow updates on X, YouTube, and LinkedIn.
0 comments
Be the first to start the discussion.