Posts

Understanding Dataverse Concurrency Issues Using Azure Service Bus Queue and Azure Functions

  Concurrency issues are one of the most challenging problems in Microsoft Dataverse when multiple operations try to update the same record simultaneously. This blog demonstrates a modern and scalable approach to handling concurrency using: Azure Service Bus Queue Azure Function Session-based message ordering instead of relying purely on plugins or synchronous Dataverse processing. What Is the Concurrency Problem? Imagine multiple transactions updating the same Contact record simultaneously. Example: Transaction Points Order 1 +20 Order 2 -50 Order 3 +10 Order 4 -15 All these operations update: Contact.TotalPoints at nearly the same time. What Happens Without Concurrency Control? Suppose current total points = 100. Two requests execute simultaneously: Request A Reads: 100 Adds: +20 Plans to update: 120 Request B Reads: 100 Subtracts: -50 Plans to update: 50 Race Condition If Request B saves after Request A: Final value becomes: 50 instea...