Concept and mechanism
A read followed by a write can lose another process’s change. ETag conditions detect that state changed before content replacement. A 412 should lead to rereading and conflict resolution, not automatic removal of protection. In Cosmos DB, a stored procedure operates transactionally within a logical partition; sharing a region or container does not extend that boundary. For blobs, a lease can coordinate writing without being a general confidentiality control for reading.
Guided application
Also design what consumers need to observe. Latest version change feed does not represent every intermediate version or physical deletion. If the business needs complete history, choose a compatible mechanism and confirm requirements, retention, and delete handling. Lifecycle policies change tiers or expire data according to rules and periodic execution; they are neither backups nor promises of instant completion. Before a change, confirm consumers, approved retention, and how to recover from an incorrect decision.
Two operators correct the same file. The second receives 412, rereads, and consolidates both changes instead of overwriting the first.
Common pitfalls
Confusing region with transaction boundary; using latest version as a complete audit log; removing If-Match to meet a deadline.
Related topics: Identity, tokens, and authorization · Telemetry and request diagnosis
Explicitly choose concurrency, observation, and retention guarantees.
Reference: Cosmos DB transactions and concurrency · AZ-204 archived objectives 2026-01-14; retired 2026-07-31