Hi @Md. Ruhul Amin Khan , welcome to Microsoft Q&A forum.
It seems that you want to achieve commit and rollback transactions across the Azure Cosmos DB multiple containers.
Currently Stored Procedure in Cosmos DB are scoped to a single logical partition key, that means any transaction within a partition key of a container can only be rolled back. Even within the same container with different partition keys rollback would not work.
We need to implement this manually through code only. As an example we can follow below steps:
- Update first collections with stored procedure and keep the record of updated items.
- Update second collection with stored procedure and return error message in case the procedure fails. Then undo the operation that we did in the first collections.
Please let us know if this helps or else we can discuss further.
----------
If answer is helpful please click on as it could help other members of the Microsoft Q&A community who have similar questions and are looking for solutions. Thank you for helping to improve Microsoft Q&A!