'How to implement transaction in Azure Function?
How to keep multiple actions in one transaction? anyone is failed, I want to roll back the whole operation. e.g. Action 1 is to write a record to Azure Table. Action 2 is to write a record to D365.
Solution 1:[1]
Have you looked at durable functions? https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-error-handling?tabs=csharp
Any exceptions are marshaled back to to the orchestrator so you will need to catch and handle each type for failure and "roll back" the completed actions yourself.
There is the idea of a transaction in Dynamics, https://docs.microsoft.com/en-us/power-apps/developer/data-platform/org-service/use-executetransaction
It will roll back ONLY what occurred during that transaction and ONLY in Dynamics. Its not really recommended, generally MS recommends that we send each request to the API as single requests, and a ExecuteTransaction Request locks the records in the transaction, so likely to have performance impact.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Chris Fernando |