Ludisposed
Ludisposed

Reputation: 1769

Trigger Azure Function when all processes are done

Is it possible to do trigger an Azure Function only when all items are processed in the Queue?

I have a Queue containing multiple Validations that needs to be done. Only after all the validations are validated it should trigger the next Azure Function that will create a report out of these validations

What I've tried


And then later on check if all are processed with this var, and only then fire off the next Azure Function

...
if (allProcessed)
{
    await createReportQueueCollector.AddAsync(formulier);
    log.Info($"Add Formulier {formulier.Guid} to create-report queue");
}

Both did not work for me... Is there a clean way to do this?

Upvotes: 0

Views: 232

Answers (1)

Mikhail Shilkov
Mikhail Shilkov

Reputation: 35154

In your code it's not clear what validations are and whether you store them externally.

Have a look at Durable Functions, they provide higher level API to correlate multiple actions. Queues are used behind the scenes but in a way hidden from developer.

Upvotes: 1

Related Questions