Stored procedures are the only way to ensure ACID (Atomic, Consistent, Isolated, Durable) transactions
that combine multiple discrete activities into a single action that can be committed or rolled back.
You cannot use client-side code to implement transactions.
What about transactional batch operations?
Cosmos DB supports transactional batch operations within a single partition. This means you can execute a set of operations (such as inserts, updates, and deletes) in an atomic batch within a single logical partition.
https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/transactional-batch?tabs=dotnet
What about transactional batch operations? Cosmos DB supports transactional batch operations within a single partition. This means you can execute a set of operations (such as inserts, updates, and deletes) in an atomic batch within a single logical partition. https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/transactional-batch?tabs=dotnet