Durable Functions debugging with clean sheet

Spread the love

Last time, my colleague asked me for help. He had a problem with Durable Functions. He tried to set a breakpoint, but executions didn’t stop.

The orchestration was complicated – it needs a few minutes to complete, and there were a lot of steps (Activity functions). The trigger was a time trigger. A breakpoint was set somewhere in the middle of orchestration.

To find out if the time trigger works correctly, we added a breakpoint at the beginning. After the start, the breakpoint was hit. We continued the execution, but immediately the breakpoint was hit once again. We tried to repeat, but the situation didn’t change.

I asked my colleague how many times he started the program, and it turned out that it was over ten times! He didn’t know that the Durable Functions store scheduled tasks, execution history and all messages on Azure Storage Account. In that situation, it was on the storage emulator. He needed a clean sheet, so we removed all queues, blob containers and tables connected with Azure Functions runtime and Durable Functions framework (Fig. 1.). All missing pieces are created during the first start of your program. But if you need to get rid of a message, you will remove the one.

Azure Functions items structure on Emulator
Fig. 1. Azure Functions items structure on Azure Storage Emulator

After we restarted the program, the execution was started only once and the necessary breakpoint was hit after a couple of minutes. Visit the orchestration history docs if you want to know more about the structure of records.

2 thoughts on “Durable Functions debugging with clean sheet

Leave a Reply

Your email address will not be published. Required fields are marked *