Azure Timer Trigger Functions in Sequence

Shreekumar Suggamad 136 Reputation points
2022-06-21T17:32:42.377+00:00

I am using Multiple TimerTrigger Functions as below

[FunctionName("Fun1")]  
public async Task RunAsync([TimerTrigger("%ScheduleExpression%")] TimerInfo myTimer, ILogger log)  
{  
      log.LogInformation($"Fun1 Timer trigger function executed at: {DateTime.Now}");  
}  

[FunctionName("Fun2")]  
public async Task RunAsync([TimerTrigger("%ScheduleExpression%")] TimerInfo myTimer, ILogger log)  
{  
      log.LogInformation($"Fun2 Timer trigger function executed at: {DateTime.Now}");  
}  

Likewise, I have a total of 5 functions. I want to run these in a sequence one after another. Because each function will save some data into individual tables and every next function will use the data stored by the previous function.

Is there any way to achieve this?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,679 questions
0 comments No comments
{count} votes

Accepted answer
  1. MughundhanRaveendran-MSFT 12,456 Reputation points
    2022-06-22T04:34:02.937+00:00

    Hi @Shreekumar Suggamad ,

    Thanks for reaching out to Q&A forum.

    The only way to achieve sequencing in timer triggered function is to schedule the timer functions in a sequential fashion using the cron expression. For example, you can schedule Fun1 to run at 12:00 AM UTC , Fun2 at 12:20 and Fun3 at 12:40.

    I hope this helps! Feel free to reach out to me if you have further queries.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful