Bida
Bida

Reputation: 459

Which azure functions to use

i want to utilize Azure Functions as background asynchronous task that potentially can last for a long time. Should I use regular Azure functions or durable azure functions? So it is like this basically:

...

var result = await SomeLongOperation();

...

Cheers

Upvotes: 0

Views: 418

Answers (1)

Pawel Maga
Pawel Maga

Reputation: 5807

First of all you need to remember about execution time limit (5 minutes) that exists in the Consumption plan. If this time is enough for you then you should use the normal Azure Functions, where is no need to use Azure Durable Functions. Alternatively, if you need more time for execution, then you need to rethink the data flow and maybe introduce a Timer trigger that runs, for example in every 5 minutes or make a use of the queue system (split one command into many). This it highly unrecommended and can introduce a high costs.

However Azure Durable Functions allows you to create eternal orchestration functions that have few advantages, like:

  • can run many activity functions multiple times with dynamic interval
  • this function can be stopped at any time
  • provides better scalability
  • remembers execution state

If these options do not meet your requirements then you can still use the more expensive App Service Plan and use Azure Web Jobs or standard Azure Functions to do this.

Upvotes: 1

Related Questions