Azure Cosmos DB limits and quotas
Azure Cosmos DB has 76 published limits, for example Maximum RUs per container (dedicated throughput provisioned mode): 1,000,000 ¹.
Quotas and limits of Azure Cosmos DB, as Microsoft Azure states it
| Limit | Value | Column (plan or default) | Adjustable |
|---|---|---|---|
| Maximum RUs per container (dedicated throughput provisioned mode) Source: learn.microsoft.com · verified | 1,000,000 ¹ | Limit | Not stated |
| Maximum RUs per database (shared throughput provisioned mode) Source: learn.microsoft.com · verified | 1,000,000 ¹ | Limit | Not stated |
| Maximum RUs per partition (logical & physical) Source: learn.microsoft.com · verified | 10,000 | Limit | Not stated |
| Maximum storage across all items per (logical) partition Source: learn.microsoft.com · verified | 20 GB ² GB | Limit | Not stated |
| Maximum number of distinct (logical) partition keys Source: learn.microsoft.com · verified | Unlimited | Limit | Not stated |
| Maximum storage per container Source: learn.microsoft.com · verified | Unlimited | Limit | Not stated |
| Maximum attachment size per Account (Attachment feature is being deprecated) Source: learn.microsoft.com · verified | 2 GB GB | Limit | Not stated |
| Minimum RU/s required per 1 GB Source: learn.microsoft.com · verified | 1 RU/s RU/s | Limit | Not stated |
| Manual throughput Source: learn.microsoft.com · verified | 400 | Limit | Not stated |
| Manual throughput Source: learn.microsoft.com · verified | 400 RU/s for first 25 containers. RU/s | Limit | Not stated |
| Autoscale throughput Source: learn.microsoft.com · verified | 1000 | Limit | Not stated |
| Autoscale throughput Source: learn.microsoft.com · verified | 1000 RU/s for first 25 containers. RU/s | Limit | Not stated |
| Maximum storage across all items per (logical) partition Source: learn.microsoft.com · verified | 20 GB ¹ GB | Limit | Not stated |
| Maximum number of distinct (logical) partition keys Source: learn.microsoft.com · verified | Unlimited | Limit | Not stated |
| Maximum storage per container Source: learn.microsoft.com · verified | Unlimited | Limit | Not stated |
| Maximum number of accounts per subscription Source: learn.microsoft.com · verified | 250 by default ¹ by | Limit | Not stated |
| Maximum number of databases & containers per account Source: learn.microsoft.com · verified | 500 ² | Limit | Not stated |
| Maximum throughput supported by an account for metadata operations Source: learn.microsoft.com · verified | 240 RU/s RU/s | Limit | Not stated |
| Maximum List or Get Keys Source: learn.microsoft.com · verified | 500 ¹ | Limit | Not stated |
| Maximum Create database & container Source: learn.microsoft.com · verified | 500 | Limit | Not stated |
| Maximum Get or List database & container Source: learn.microsoft.com · verified | 500 ¹ | Limit | Not stated |
| Maximum Update provisioned throughput Source: learn.microsoft.com · verified | 25 | Limit | Not stated |
| Maximum regional failover Source: learn.microsoft.com · verified | 10 (per hour) ² | Limit | Not stated |
| Maximum number of all operations (PUT, POST, PATCH, DELETE, GET) not defined previously Source: learn.microsoft.com · verified | 500 | Limit | Not stated |
| Maximum custom role definitions per account (native data plane RBAC) Source: learn.microsoft.com · verified | 100 | Default limit | Not stated |
| Maximum role assignments per account (native data plane RBAC) Source: learn.microsoft.com · verified | 2,000 | Default limit | Not stated |
| Maximum number of databases and containers per account Source: learn.microsoft.com · verified | 500 | Limit | Not stated |
| Maximum number of containers per database with shared throughput Source: learn.microsoft.com · verified | 25 | Limit | Not stated |
| Maximum number of databases and containers per account Source: learn.microsoft.com · verified | 500 | Limit | Not stated |
| Maximum number of regions Source: learn.microsoft.com · verified | 1 (any Azure region) | Limit | Not stated |
| Maximum length of database or container name Source: learn.microsoft.com · verified | 255 | Limit | Not stated |
| Maximum number of stored procedures per container Source: learn.microsoft.com · verified | 100 ¹ | Limit | Not stated |
| Maximum number of UDFs per container Source: learn.microsoft.com · verified | 50 ¹ | Limit | Not stated |
| Maximum number of unique keys per container Source: learn.microsoft.com · verified | 10 ¹ | Limit | Not stated |
| Maximum number of paths per unique key constraint Source: learn.microsoft.com · verified | 16 ¹ | Limit | Not stated |
| Maximum time-to-live (TTL) value Source: learn.microsoft.com · verified | 2,147,483,647 | Limit | Not stated |
| Maximum size of an item Source: learn.microsoft.com · verified | 2 MB (UTF-8 length of JSON representation) ¹ MB | Limit | Not stated |
| Maximum length of partition key value Source: learn.microsoft.com · verified | 2,048 bytes (101 bytes if large partition-key isn't enabled) bytes | Limit | Not stated |
| Maximum length of ID value Source: learn.microsoft.com · verified | 1,023 bytes bytes | Limit | Not stated |
| Allowed characters for ID value Source: learn.microsoft.com · verified | Service-side all Unicode characters except for '/' and '\' are allowed. WARNING: But for best interoperability we STRONGLY RECOMMEND to only use alpha-numerical ASCII characters in the ID value only. There are known limitations in some versions of the Cosmos DB SDK, and connectors (Azure Data Factory, Spark, Kafka, etc.) and HTTP drivers or libraries. These limitations can prevent successful processing when the ID value contains nonalphanumerical ASCII characters. So, to increase interoperability, encode the ID value - for example via Base64 + custom encoding of special characters allowed in Base64. - if you have to support nonalphanumerical ASCII characters in your service/application. | Limit | Not stated |
| Maximum length of numeric property value Source: learn.microsoft.com · verified | IEEE754 double-precision 64-bit | Limit | Not stated |
| Maximum level of nesting for embedded objects / arrays Source: learn.microsoft.com · verified | 128 | Limit | Not stated |
| Maximum TTL value Source: learn.microsoft.com · verified | 2147483647 | Limit | Not stated |
| Maximum precision/range for numbers in JSON (to ensure safe interoperability) Source: learn.microsoft.com · verified | Institute of Electrical and Electronics Engineers (IEEE) 754 binary64 | Limit | Not stated |
| Maximum execution time for a single operation (like a stored procedure execution or a single query page retrieval) Source: learn.microsoft.com · verified | 5 sec sec | Limit | Not stated |
| Maximum request size (for example, stored procedure, CRUD) Source: learn.microsoft.com · verified | 2 MB MB | Limit | Not stated |
| Maximum response size (for example, paginated query) Source: learn.microsoft.com · verified | 4 MB MB | Limit | Not stated |
| Maximum number of operations in a transactional batch Source: learn.microsoft.com · verified | 100 | Limit | Not stated |
| Maximum primary token expiry time Source: learn.microsoft.com · verified | 15 min min | Limit | Not stated |
| Minimum resource token expiry time Source: learn.microsoft.com · verified | 10 min min | Limit | Not stated |
| Maximum resource token expiry time Source: learn.microsoft.com · verified | 24 h by default ¹ h | Limit | Not stated |
| Maximum clock skew for token authorization Source: learn.microsoft.com · verified | 15 min min | Limit | Not stated |
| Minimum RU/s the system can scale to Source: learn.microsoft.com · verified | 0.1 * Tmax | Limit | Not stated |
| Current RU/s the system is scaled to Source: learn.microsoft.com · verified | 0.1*Tmax <= T <= Tmax, based on usage | Limit | Not stated |
| Minimum billable RU/s per hour Source: learn.microsoft.com · verified | 0.1 * Tmax Billing is per hour, based on the highest RU/s the system scaled to during the hour, or 0.1*Tmax, whichever is higher. | Limit | Not stated |
| Minimum autoscale max RU/s for a container Source: learn.microsoft.com · verified | MAX(1000, highest max RU/s ever provisioned / 10, current storage in GB * 10) rounded up to nearest 1000 RU/s | Limit | Not stated |
| Minimum autoscale max RU/s for a database Source: learn.microsoft.com · verified | MAX(1000, highest max RU/s ever provisioned / 10, current storage in GB * 10, 1000 + (MAX(Container count - 25, 0) * 1000)) rounded up to the nearest 1000 RU/s. If your database has more than 25 containers, the system increases the minimum autoscale max RU/s by 1000 RU/s for each extra container. For example, if you have 30 containers, the lowest autoscale maximum RU/s you can set is 6000 RU/s (scaling between 600 and 6000 RU/s). | Limit | Not stated |
| Maximum length of SQL query Source: learn.microsoft.com · verified | 512 KB KB | Limit | Not stated |
| Maximum JOIN statements per query Source: learn.microsoft.com · verified | 10¹ | Limit | Not stated |
| Maximum UDFs per query Source: learn.microsoft.com · verified | 10 ¹ | Limit | Not stated |
| Maximum points per polygon Source: learn.microsoft.com · verified | 4096 | Limit | Not stated |
| Maximum explicitly included paths per container Source: learn.microsoft.com · verified | 1500 ¹ | Limit | Not stated |
| Maximum explicitly excluded paths per container Source: learn.microsoft.com · verified | 1500 ¹ | Limit | Not stated |
| Maximum properties in a composite index Source: learn.microsoft.com · verified | 8 | Limit | Not stated |
| Maximum number of paths in a composite index Source: learn.microsoft.com · verified | 100 | Limit | Not stated |
| Maximum size of a document Source: learn.microsoft.com · verified | 16 MB (UTF-8 length of JSON representation) ¹ MB | Limit | Not stated |
| Maximum MongoDB query memory size (applies only to the 3.2 server version) Source: learn.microsoft.com · verified | 40 MB MB | Limit | Not stated |
| Maximum execution time for MongoDB operations (applies to the 3.2 server version) Source: learn.microsoft.com · verified | 15 seconds seconds | Limit | Not stated |
| Maximum execution time for MongoDB operations (applies to the 3.6 and 4.0 server versions) Source: learn.microsoft.com · verified | 60 seconds seconds | Limit | Not stated |
| Maximum level of nesting for embedded objects / arrays on index definitions Source: learn.microsoft.com · verified | 6 | Limit | Not stated |
| Idle connection timeout for server side connection closure ² Source: learn.microsoft.com · verified | 30 minutes minutes | Limit | Not stated |
| Time limit for MongoDB shell in the Azure portal Source: learn.microsoft.com · verified | 120 minutes in a 24 hour period minutes | Limit | Not stated |
| Number of free tier accounts per Azure subscription Source: learn.microsoft.com · verified | 1 | Limit | Not stated |
| Maximum RU/s for free Source: learn.microsoft.com · verified | 1000 RU/s RU/s | Limit | Not stated |
| Maximum storage for free Source: learn.microsoft.com · verified | 25 GB GB | Limit | Not stated |
| Maximum number of containers in a shared throughput database Source: learn.microsoft.com · verified | 25 | Limit | Not stated |