Databases

Cosmos DB

Microsoft.DocumentDB

Resource types
57 of 57 supported
Data plane
10 types emulated
API versions
51 newest 2026-07-15
Ships as
Plugin 2026.11
Plan
Standard and above

Data as of 2026-11-20

Resource types

The Resource Types supported by Locally for the Microsoft.DocumentDB plugin are shown below. You can click into a type to see more information.

Note: This is generated from the latest version of the plugin (2026.11) as of 2026-11-20, and may differ in older versions. We aim to keep this information accurate and up to date; if you find something we're missing, then please let us know.

API versions

The latest API version that Locally supports for Microsoft.DocumentDB is 2026-07-15. All 51 versions it supports are listed below.

Stable27

2026-07-15 2026-06-01 2026-03-15 2025-10-15 2025-09-01 2025-04-15 2024-11-15 2024-08-15 2024-05-15 2023-11-15 2023-09-15 2023-04-15 2023-03-15 2022-11-15 2022-08-15 2022-05-15 2021-10-15 2021-06-15 2021-05-15 2021-04-15 2021-03-15 2021-01-15 2020-09-01 2020-04-01 2020-03-01 2019-12-12 2019-08-01

Preview24

2026-06-15-preview 2026-04-01-preview 2026-02-01-preview 2025-11-01-preview 2025-05-01-preview 2024-12-01-preview 2024-09-01-preview 2024-05-15-preview 2024-02-15-preview 2023-11-15-preview 2023-09-15-preview 2023-03-15-preview 2023-03-01-preview 2022-11-15-preview 2022-08-15-preview 2022-05-15-preview 2022-02-15-preview 2021-11-15-preview 2021-10-15-preview 2021-07-01-preview 2021-04-01-preview 2021-03-01-preview 2020-06-01-preview 2019-08-01-preview

Features

  • API for NoSQL: databases, containers and items, through the Azure Cosmos DB SDKs in gateway or Direct mode.
  • API for MongoDB: CRUD, the aggregation pipeline, change streams and multi-document transactions.
  • API for Table: tables, entities and batch operations.
  • MongoDB vCore clusters (mongoClusters), with a MongoDB endpoint and vector search through $search.
  • SQL queries, including cross-partition queries, JOIN, subqueries, aggregates, GROUP BY, DISTINCT, ORDER BY and OFFSET/LIMIT.
  • Vector, full-text and hybrid search
  • Stored procedures, triggers and user-defined functions are run, not just stored.
  • Change feed in latest version mode and all versions and deletes mode.
  • Transactional batch and bulk
  • Partial document update (patch).
  • Time to live
  • Provisioned, autoscale and serverless throughput, with requests charged Request Units and an HTTP 429 when you go over.
  • Point-in-time restore for the NoSQL and Table APIs.
  • Microsoft Entra authentication, checked against the account's data plane role assignments.
  • Account keys and resource tokens, including read-only keys and disabling local authentication.
  • Function App triggers and bindings: the change feed drives Cosmos DB triggers in the Function App emulator, and input and output bindings read and write items.
  • Chaos Engineering can throttle, fail, slow down or drop requests to the SQL, MongoDB and Table APIs, fail over a region or serve stale reads. Team

Limitations

Cassandra Keyspaces

  • Cassandra keyspaces can be created, but there's no Cassandra endpoint behind them at this time.

Collections

  • $setWindowFields, $bucket, $densify, $fill and $unionWith are rejected, and $graphLookup needs server version 4.0 or earlier.
  • Autoscale throughput can't be set through the extension commands at this time.
  • MongoDB collections aren't covered by restore at this time.
  • Stages after $changeStream are rejected at this time.
  • Tailable cursors aren't supported at this time.
  • The pipeline form of $lookup is rejected at this time.

Container Throughput Settings

  • Autoscale throughput doesn't scale with load at this time.
  • The 400 RU/s minimum for manual throughput isn't enforced at this time.

Containers

  • A cross-partition query with an aggregate inside a larger expression, or with ORDER BY and GROUP BY together, can return wrong results from the .NET SDK.
  • Custom analyzers in a full-text policy aren't supported at this time.
  • Paging with a continuation token can skip or repeat items if the container is written to between pages at this time.
  • Partitions don't split or merge at this time.
  • ST_AREA isn't supported, and ST_WITHIN and ST_INTERSECTS use planar geometry, so very large shapes can give different results.

Database Accounts

  • A restore timestamp outside the backup retention window is currently accepted and will be fixed in a future release.
  • Every region serves the same single copy of the data at this time, so every consistency level reads the latest write, and conflicts never happen.
  • Gremlin and Cassandra accounts can be created, but there's no Gremlin or Cassandra endpoint behind them at this time.
  • Restore only covers the NoSQL and Table APIs at this time, and restoreLocation is ignored.
  • The restorable resource lists only include databases, containers and tables created through Azure Resource Manager at this time.

Gremlin Databases

  • Gremlin databases can be created, but there's no Gremlin endpoint behind them at this time.

Mongo Clusters

  • On macOS, MongoDB drivers and mongosh can't resolve the mongodb+srv:// connection strings that List Connection Strings returns at this time. Connect with mongodb:// and port 5666 instead, for example mongodb://<user>:<password>@{name}-mongocluster-global.cosmonaut.locally:5666/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false.
  • Only native (SCRAM) authentication is served at this time. There's no MONGODB-OIDC, so the MicrosoftEntraID auth mode and Microsoft Entra users can't sign in.
  • Some aggregation stages and expression operators aren't supported at this time.

MongoDB Databases

  • Database-level throughput can't be set through the extension commands at this time.
  • MongoDB databases aren't covered by restore at this time.
  • Users can't be managed over the wire protocol at this time.

SQL Database Throughput Settings

  • Autoscale throughput doesn't scale with load at this time.
  • The 400 RU/s minimum for manual throughput isn't enforced at this time.

SQL Databases

  • Restoring a deleted database brings back every container deleted with it at this time, even ones created after the restore timestamp.

Stored Procedures

  • A query inside a stored procedure can't call a user-defined function at this time.
  • Stored procedures have no execution time limit at this time, so isAccepted is always true.

Triggers

  • Pre-triggers can't use getCollection() at this time.

User Defined Functions

  • A user-defined function can't be called from a query inside a stored procedure at this time.

Examples

Runnable examples from the examples library.

Deploying a Cosmos DB-backed app to App Service Deploy a TypeScript Tasks app to App Service with Terraform, storing its data in Cosmos DB and connecting to it with a managed identity. app-serviceazurerm-providercosmos-dbhashicorp-terraformopentofu Deploy a Cosmos DB Account to Locally using an ARM Template Provisions a Cosmos DB for NoSQL account using Session consistency, into a Resource Group of your choosing. arm-template Deploy a Cosmos DB SQL Container to Locally using an ARM Template Provisions a Cosmos DB for NoSQL account, a SQL Database and a Container partitioned on /id, into a Resource Group of your choosing. arm-template Deploy a Cosmos DB SQL Database to Locally using an ARM Template Provisions a Cosmos DB for NoSQL account and a SQL Database with 400 RU/s of provisioned throughput, into a Resource Group of your choosing. arm-template Deploy a Cosmos DB Account to Locally using a Bicep Template Provisions a Cosmos DB for NoSQL account using Session consistency, into a Resource Group of your choosing. bicep Deploy a Cosmos DB SQL Container to Locally using a Bicep Template Provisions a Cosmos DB for NoSQL account, a SQL Database and a Container partitioned on /id, into a Resource Group of your choosing. bicep Deploy a Cosmos DB SQL Database to Locally using a Bicep Template Provisions a Cosmos DB for NoSQL account and a SQL Database with 400 RU/s of provisioned throughput, into a Resource Group of your choosing. bicep Deploy a Cosmos DB Account to Locally using Terraform and the Azure/azapi provider Provisions a Resource Group containing a Cosmos DB for NoSQL account using Session consistency. azapi-providerhashicorp-terraform Deploy a Cosmos DB SQL Container to Locally using Terraform and the Azure/azapi provider Provisions a Resource Group containing a Cosmos DB for NoSQL account, a SQL Database and a Container partitioned on /id. azapi-providerhashicorp-terraform Deploy a Cosmos DB SQL Database to Locally using Terraform and the Azure/azapi provider Provisions a Resource Group containing a Cosmos DB for NoSQL account and a SQL Database with 400 RU/s of provisioned throughput. azapi-providerhashicorp-terraform Deploy a Cosmos DB Account to Locally using Terraform and the hashicorp/azurerm provider Provisions a Resource Group containing a Cosmos DB for NoSQL account using Session consistency. azurerm-providerhashicorp-terraform Deploy a Cosmos DB SQL Container to Locally using Terraform and the hashicorp/azurerm provider Provisions a Resource Group containing a Cosmos DB for NoSQL account, a SQL Database and a Container partitioned on /id. azurerm-providerhashicorp-terraform Deploy a Cosmos DB SQL Database to Locally using Terraform and the hashicorp/azurerm provider Provisions a Resource Group containing a Cosmos DB for NoSQL account and a SQL Database with 400 RU/s of provisioned throughput. azurerm-providerhashicorp-terraform Deploy a Cosmos DB Account to Locally using OpenTofu and the Azure/azapi provider Provisions a Resource Group containing a Cosmos DB for NoSQL account using Session consistency. azapi-provideropentofu Deploy a Cosmos DB SQL Container to Locally using OpenTofu and the Azure/azapi provider Provisions a Resource Group containing a Cosmos DB for NoSQL account, a SQL Database and a Container partitioned on /id. azapi-provideropentofu Deploy a Cosmos DB SQL Database to Locally using OpenTofu and the Azure/azapi provider Provisions a Resource Group containing a Cosmos DB for NoSQL account and a SQL Database with 400 RU/s of provisioned throughput. azapi-provideropentofu Deploy a Cosmos DB Account to Locally using OpenTofu and the opentofu/azurerm provider Provisions a Resource Group containing a Cosmos DB for NoSQL account using Session consistency. azurerm-provideropentofu Deploy a Cosmos DB SQL Container to Locally using OpenTofu and the opentofu/azurerm provider Provisions a Resource Group containing a Cosmos DB for NoSQL account, a SQL Database and a Container partitioned on /id. azurerm-provideropentofu Deploy a Cosmos DB SQL Database to Locally using OpenTofu and the opentofu/azurerm provider Provisions a Resource Group containing a Cosmos DB for NoSQL account and a SQL Database with 400 RU/s of provisioned throughput. azurerm-provideropentofu

Documentation

A local cloud for you and your AI agents.

Your Azure infrastructure, running on your machine. Deploy in seconds, break things freely, and ship to Azure when you're ready.