Share via

PatchItemAsync sometimes does not update the document in the Cosmos but returns an OK StatusCode

Althea U Guerra 0 Reputation points
2024-01-31T18:20:53.16+00:00

I have a durable function that accepts list of objects and chains two activities:

  1. Activity 1: Process and send this list of objects to a third party system one by one and returns back an id to be updated in the object's property
  2. Activity 2: Update this list of updated objects into Azure Cosmos Db within for loop using PatchItemAsync

Issue: Most of the time, there will be an object/document (item count is very random, there will be one, sometimes 4 or more and sometimes all are successfully updated) in the list of objects that will not be updated but the ItemResponse from PatchItemAsync is OK. But if the function receives one, object is always updated successfully.

What could be the root cause of this issue?

Programming Language: C# .Net

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.