Databases Database premium premium field-manual-complete

Cosmos DB account

A Cosmos DB account is the main Azure resource you create before building databases and containers in Azure Cosmos DB. It is where you choose the API model, regions, consistency approach, backup mode, network access, keys, identities, and other account-level settings. Think of it as the control boundary for a globally distributed database estate. Applications connect to the account endpoint, while administrators manage data placement, access, reliability, and cost decisions from the account configuration. Document ownership, monitoring, approval, and exception handling before depending on it for a critical workload.

Aliases
Cosmos DB account, cosmos db account
Difficulty
intermediate
CLI mappings
5
Last verified
2026-06-02

Microsoft Learn

Microsoft Learn describes an Azure Cosmos DB account as the top-level resource that contains databases and containers. Within an account, teams choose API, regions, consistency, backup, networking, and throughput-related configuration, while databases and containers organize data and scale units beneath that account.

Microsoft Learn: Databases, containers, and items - Azure Cosmos DB2026-06-02

Technical context

Technically, the Cosmos DB account is the parent resource for databases, containers, throughput configuration, consistency settings, replication regions, failover priorities, analytical storage capability, backup policy, and network controls. The account type determines which API surface is used, such as NoSQL, MongoDB, Cassandra, Gremlin, or Table. Containers inside the account handle partitioning, indexing, and request unit consumption. Architects should decide account boundaries based on workload isolation, compliance, latency regions, operational ownership, and limits rather than creating one account for every small feature.

Why it matters

A Cosmos DB account matters because many high-impact database choices live above an individual container. Region selection affects latency and resilience. Consistency affects application behavior. Backup mode affects recovery options. Networking and keys affect security posture. Throughput and autoscale settings affect cost and performance. When teams treat the account as a casual wrapper, they may discover too late that a regulatory boundary, failover plan, or API choice was wrong. Good account design gives applications a stable data platform while keeping administration, monitoring, and governance understandable. It should be reviewed with real users, clear ownership, and measurable service outcomes before being treated as mature production design.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

In the Azure portal, the account overview shows endpoint, API type, locations, consistency, backup policy, networking, keys, metrics, and diagnostic settings during daily operations and audits.

Signal 02

In resource templates, the account appears as a Microsoft.DocumentDB databaseAccounts resource with properties for locations, capabilities, consistency, backup, and network rules during daily operations and audits.

Signal 03

In operations dashboards, signals include request units, throttled requests, storage growth, regional availability, failover priority, key rotations, and private endpoint status during daily operations and audits.

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Design the account boundary for a global application before choosing databases, containers, regions, consistency, and backup mode.
  • Separate regulated, tenant-specific, or production workloads into dedicated Cosmos DB accounts with different networking and key-rotation controls.
  • Confirm regional replication, automatic failover, consistency, and backup settings before a major launch or disaster-recovery test.
  • Inventory account-level private endpoints, firewall rules, managed identities, and keys before tightening public network access.
  • Compare request-unit, storage, region, and account-count growth across subscriptions during a FinOps or capacity planning review.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Global player profile platform

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

Fabrikam Play needed a database platform for player profiles that served users in North America, Europe, and Asia with low latency.

Business/Technical Objectives
  • Keep profile reads below 20 milliseconds in major regions
  • Support regional failover without a schema migration
  • Govern account keys and private access
  • Control request unit growth during game launches
Solution Using Cosmos DB account

The architecture team created a Cosmos DB account for the NoSQL API with replication regions near major player populations. Containers used partition keys based on player ID, and autoscale throughput handled launch-day spikes. Private endpoints connected game services to the account, and managed deployment templates controlled consistency, backup mode, and regional failover priorities. Dashboards tracked request units, latency, throttling, storage, and region health. A separate account was reserved for analytics experiments so production profile data stayed isolated. The team also documented owners, rollback steps, dashboards, and escalation paths so support staff could handle exceptions without redesigning the solution.

Results & Business Impact
  • Profile read latency met the target in all three launch regions
  • A regional failover test completed without changing application connection code
  • Public network access was disabled before production release
  • Autoscale absorbed a traffic spike 4.5 times higher than baseline without emergency provisioning
Key Takeaway for Glossary Readers

A Cosmos DB account is the strategic boundary where global database behavior, access, and cost are designed.

Case study 02

Patient portal data boundary

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

Evergreen Care Network modernized its patient portal and needed strong separation between patient records, appointment preferences, and experimental analytics workloads.

Business/Technical Objectives
  • Separate regulated patient data from exploratory analytics
  • Provide point-in-time recovery for critical portal data
  • Use private connectivity from application services
  • Give auditors clear ownership of database settings
Solution Using Cosmos DB account

The cloud team placed patient-facing NoSQL containers in a dedicated Cosmos DB account with private endpoints, Microsoft Entra controlled access, continuous backup, and diagnostic logging. Appointment preference data used separate containers with explicit throughput controls, while experimental analytics used a different account. Infrastructure as code documented account settings, consistency policy, backup mode, regions, and network restrictions. Operations dashboards monitored throttling, latency, restore readiness, and key access events. The team also documented owners, rollback steps, dashboards, and escalation paths so support staff could handle exceptions without redesigning the solution. Post-implementation reviews converted lessons learned into updated standards, training notes, and release checklists for future teams. Support teams reviewed the outcome with business owners and converted the operating model into a maintained runbook.

Results & Business Impact
  • Audit findings on database boundary ownership were closed before go-live
  • Recovery testing proved a restore point within the agreed window
  • Private endpoint traffic replaced public database access
  • Cost reports separated portal demand from analytics experimentation
Key Takeaway for Glossary Readers

Account boundaries help regulated teams keep security, recovery, and ownership decisions visible.

Case study 03

Logistics event database

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

BlueRiver Freight used Cosmos DB for shipment events but frequent throttling made dispatch dashboards unreliable during peak routing windows.

Business/Technical Objectives
  • Reduce dashboard throttling below 2 percent
  • Identify whether cost came from reads, writes, or hot partitions
  • Keep regional operations online during local outages
  • Standardize account monitoring for support teams
Solution Using Cosmos DB account

Architects reviewed the Cosmos DB account, containers, partition keys, consistency, and region settings. They found one container partitioned by status, which concentrated writes during peak dispatch periods. The team redesigned the container around shipment ID, adjusted indexing for dashboard queries, and set autoscale maximums based on real load tests. Account-level alerts covered normalized RU consumption, throttling, latency, and regional health. CLI commands gave operators repeatable checks for account configuration during incidents. The team also documented owners, rollback steps, dashboards, and escalation paths so support staff could handle exceptions without redesigning the solution. Post-implementation reviews converted lessons learned into updated standards, training notes, and release checklists for future teams.

Results & Business Impact
  • Peak throttling fell from 14 percent to 1.3 percent
  • Dashboard p95 latency improved by 46 percent
  • Monthly spend stabilized after unnecessary overprovisioning was removed
  • Support teams used one workbook to diagnose account and container health
Key Takeaway for Glossary Readers

A Cosmos DB account performs best when account settings and container design are tuned together.

Why use Azure CLI for this?

With ten years of Azure operations behind me, I use Azure CLI for Cosmos DB accounts because account-level settings are too important to verify from memory or screenshots. CLI shows the actual subscription, region list, consistency policy, backup policy, network rules, failover settings, identities, and tags in a repeatable format. That matters during reviews, incidents, migrations, and cost cleanups. Portal clicks are fine for exploration, but CLI output can be checked into evidence, compared across environments, and wired into pipeline gates before a risky account-level change reaches production. It also reduces ambiguity when several teams share operational responsibility during emergencies.

CLI use cases

  • List Cosmos DB accounts in a resource group for governance review.
  • Show an account to confirm regions, consistency, networking, and backup settings.
  • Update failover priorities during a planned resilience test.

Before you run CLI

  • Confirm the API type and account name because several workloads may share one account.
  • Avoid listing keys unless approved; prefer identity and RBAC for routine checks.
  • Understand whether an update affects all databases and containers under the account.

What output tells you

  • Account output shows locations, consistency policy, backup policy, capabilities, network settings, and provisioning state.
  • Database and container output shows how the account is being used by workloads.
  • Failover output confirms priority configuration but application testing proves real recovery behavior.

Mapped Azure CLI commands

Cosmos DB account operations

direct
az cosmosdb list --resource-group <resource-group> --output table
az cosmosdbdiscoverDatabases
az cosmosdb show --name <account-name> --resource-group <resource-group>
az cosmosdbdiscoverDatabases
az cosmosdb create --name <account-name> --resource-group <resource-group> --locations regionName=<region> failoverPriority=0 --default-consistency-level Session
az cosmosdbprovisionDatabases
az cosmosdb update --name <account-name> --resource-group <resource-group> --enable-automatic-failover true
az cosmosdbconfigureDatabases
az cosmosdb keys list --name <account-name> --resource-group <resource-group>
az cosmosdb keysdiscoverDatabases

Architecture context

A Cosmos DB account is the control boundary for a distributed database estate. I review it before any container design because it sets API type, regions, consistency, backup mode, networking, identity, encryption, analytical store capability, and failover behavior. Account choices can be hard to unwind after applications, SDK clients, and data models depend on them. The architecture should define write region strategy, private endpoint usage, key or RBAC access, diagnostic settings, budget ownership, and how new databases and containers are governed. Operators should inspect account state, replication policy, capabilities, failover priorities, backup configuration, and throughput model before a major release. A healthy account design gives teams room to scale without surprising them on availability, latency, or recovery.

Security

Security for a Cosmos DB account starts with controlling management plane and data plane access. Use Microsoft Entra authentication and role-based access where appropriate, restrict keys, rotate secrets, disable public network access when private endpoints are required, and review firewall rules. Diagnostic logs should capture configuration and data-access events without exposing sensitive documents. Separate accounts when workloads have different regulatory or tenant boundaries. Operators should protect backup and restore permissions, analytical access, and connection strings because account-level compromise can expose multiple databases and containers. Review exceptions regularly, document approved data flows, and make sure support staff understand what they may safely inspect.

Cost

Cost for a Cosmos DB account is driven by provisioned or autoscale request units, serverless usage, storage, regions, backup, analytical storage, and data transfer. Adding regions can multiply throughput cost, while poor partition keys can force teams to overprovision to hide hot partitions. Autoscale helps variable workloads but still needs maximum throughput governance. Storage growth, indexing policy, and analytical features should be reviewed with usage patterns. The account boundary also affects chargeback: one shared account may hide which application creates spend unless databases, containers, and tags are monitored carefully. Compare the bill with actual business value, operational effort, and risk reduction instead of judging only the unit price.

Reliability

Reliability for a Cosmos DB account is shaped by region strategy, consistency level, backup policy, failover configuration, and container design. Multi-region replication can improve resilience, but it must match application write patterns and conflict expectations. Continuous backup can support point-in-time recovery for supported workloads, while periodic backup has different restore behavior. Test regional failover, validate SDK retry settings, and monitor request unit throttling, availability, and replication lag. Reliability also depends on partition keys and indexing because hot partitions or expensive queries can make a healthy account feel unavailable. Practice the failure path, record recovery evidence, and keep human escalation available for cases automation cannot safely resolve.

Performance

Performance for a Cosmos DB account depends on region proximity, consistency, partitioning, indexing, request unit capacity, SDK configuration, and query patterns. Choosing the nearest region helps latency, but a bad partition key can still create hot logical partitions. Stronger consistency or multi-region writes can change latency and conflict behavior. Monitor p95 and p99 request latency, throttling, query metrics, and normalized RU consumption by container. Tune indexing and queries before simply raising throughput. Account design should support predictable access patterns rather than relying on emergency scale changes. Measure end-to-end behavior under realistic volume, because clean lab tests often miss the bottlenecks that users actually feel.

Operations

Operationally, a Cosmos DB account needs disciplined monitoring and change management. Runbooks should cover keys, RBAC, private endpoints, consistency, failover priority, backup mode, throughput, indexing changes, and container creation. Operators should watch request units, normalized RU consumption, throttled requests, storage growth, latency, availability, and regional health. Changes to regions, backup policy, or networking can affect many applications at once. Use tags, naming standards, alerts, Azure Policy, and infrastructure as code so account configuration is reviewable instead of hidden in portal clicks. Keep rollback steps, dashboards, service owners, and escalation contacts current so support teams can act without guessing under pressure.

Common mistakes

  • Creating one shared account for unrelated workloads with different compliance needs.
  • Treating more throughput as the first fix for poor partition or query design.
  • Leaving public network access and account keys broadly available after production launch.