How to execute a lot of durable functions triggered by Azure Queue?

  1. Yes this is a totally valid way to kick off orchestrations!
  2. Sure, here's some details on the architecture as it relates to performance and scalability.
  3. I think what you're probably intending to ask here is: how many orchestration instances of a single durable function definition can be executed at the same time? This is indeed a very important aspect to understand. Orchestration functions themselves are single threads and, per that link on scale I gave you above, are balanced across a set of control queues. You can read the document for more information, but the bottom line is you don't want to do any work other than actual orchestration in your orchestration function because they are your limit on scalability. It is the orchestration action functions which behave like any other Azure Function and have virtually no limits on their scalability.

You did elide some code from your orchestration trigger in the question above for the purposes of brevity which I understand, but what exactly are you doing there after the await Task.WhenAll(...)? If it includes any kind of significant processing you should really be farming that out to a third action function (e.g. Function_3) to do and then simply returning the results from the orchestration function.

Update: I just noticed your functions are defined as async void. If I had to guess, this would actually cause a problem for the runtime. Can you try changing it to async Task and see if your problem goes away? As a general rule defining methods as async void is frowned upon in .NET.


Some extension for Drew's answer. You should not use Thread.Sleep(), as the documentation states, instead use CreateTimer Api.