I'm Using Azure Durable Functions .Net Core.
[FunctionName("Calculate")]
public async Task RunOrchestrator(
[OrchestrationTrigger] IDurableOrchestrationContext context, ILogger log)
{
await context.CallActivityAsync<object>(FuncConstants.Cal1, null);
await context.CallActivityAsync<object>(FuncConstants.Cal2, null);
await context.CallActivityAsync<object>(FuncConstants.Cal3, null);
await context.CallActivityAsync<object>(FuncConstants.Cal4, null);
await context.CallActivityAsync<object>(FuncConstants.Cal5, null);
await context.CallActivityAsync<object>(FuncConstants.Cal6, null);
await context.CallActivityAsync<object>(FuncConstants.Cal7, null);
await context.CallActivityAsync<object>(FuncConstants.Cal8, null);
await context.CallActivityAsync<object>(FuncConstants.Cal9, null);
}
[FunctionName("Starter_Calculation")]
public static async Task<HttpResponseMessage> HttpStart(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestMessage req,
[DurableClient] IDurableOrchestrationClient starter,
ILogger log)
{
string instanceId = await starter.StartNewAsync("Calculate", null);
return starter.CreateCheckStatusResponse(req, instanceId);
}
Here, each function takes more than 5-6 hours to perform some logical calculations (arithmetic operations) as they deal with more than 27-30 million database records.
I'm getting the error for the first function itself as "Timeout value of 00:30:00 was exceeded by function
. In Azure, I'm using Premium App Service Plan
, so I can set AlwaysOn
.
I have a couple of questions:
- Is Azure Function the best fit for such a scenario/long-running operations?
- If yes, is there any way I can test it locally without a time-out error?
Please advice.