Hello @john john Pter - On your specific question about whether the Durable Functions are bound by the 10mins timeout limit when running on Consumption SKU, the following is stated in the docs:
If your function app uses the Consumption plan, you'll still be billed for any time and memory consumed by the abandoned activity function. By default, functions running in the Consumption plan have a timeout of five minutes. If this limit is exceeded, the Azure Functions host is recycled to stop all execution and prevent a runaway billing situation.
Some interesting points come to mind when we unpack the above in the context of your use case.
- Regarding Timeout on Consumption SKU
- Even though Durable Functions are indeed bound by the 10mins limit, it may not necessarily be a show-stopper for your use case because, in reality, the 10min limit affects the Activity Functions only. When the timeout exceeds and the Functions host is recycled, Orchestrator functions will just Replay leveraging its event sourcing pattern and resume work. This is where the "durability" of Durable Functions comes into the picture: it uses external storage, known as taskHub, to keep track of the work that Durable Functions is carrying out (which in your case is fetching paginated data from Sharepoint), and enables Durable Functions to resume that work if unfinished from sudden failures such as TimeOuts, VM reboots, crashes, etc.
- You might also look into if waking up the Orchestrator function at a set timer using the
DurableOrchestrationContext.CreateTimer
method helps too, see: Durable Functions and Consumption plan pricing - Fetching 2M records daily in paginated & throttled calls is quite an undertaking in terms of compute and memory utilization, you might consider introducing nested Sub-Orchestrations to your code (as it'll allow distribution of the work across multiple VMs) and coordinating results with design patterns such as Fan Out & Fan in. Perhaps, this is also where choosing Consumption SKU has an upside for you with its dynamic scale relative to variable workload as opposed to ASP and other dedicated SKUs with fixed amount of resources.
- Cost & Billing:
- The approach described above lets the Functions host recycle & replay the work. If an Activity Function was in progress fetching list data but timeout hits and terminates it, you'll still be billed for any time and memory consumed by the abandoned activity function. I'm not what the exact numbers will be but I wanted to bring Logic Apps to your consideration for the following:
- Logic app also only runs when it needs to. Plus you pay for actions executed, not for time processing. Logic apps do only have per-execution model pricing.
- Limits of Logic apps are much more relaxed than functions (for example run duration is 90 days, recurrence time interval up to 500 days …)
- In logic apps you do not have to write a code – you construct a workflow that has triggers and actions. Sharepoint Connector includes an operation for getting Lists data.
- The approach described above lets the Functions host recycle & replay the work. If an Activity Function was in progress fetching list data but timeout hits and terminates it, you'll still be billed for any time and memory consumed by the abandoned activity function. I'm not what the exact numbers will be but I wanted to bring Logic Apps to your consideration for the following:
I hope the above helps. Feel free to tag me and comment below if you have any follow-up questions.
Please "Accept Answer" if the answer is helpful so that others in the community may benefit from your experience.