We have created an azure function which is set as timer triggered . We want to schedule invoke the same func012.tion in different time intervals. i.e
1) Every Week Friday with certain set of input parameters 2) Every Month Last day with certain set of input parameters
Thanks
The timer trigger can only take a single cron schedule.
Do this as a union of schedules. Have multiple timer triggers - each with a part of the schedule (Friday vs. Monday) and then each can call to a common function passing the respective parameters.
Here is a sample
public async Task FunctionLogicOnTimer(string parameter)
{
// ...
// ...
}
[FunctionName(nameof(MyFunc1))]
public async Task MyFunc1(
[TimerTrigger("%MyTimerIntervalFromSettings1%")] TimerInfo timer, ILogger log)
{
// ...
// ...
FunctionLogicOnTimer("I am triggered from MyFunc1");
}
[FunctionName(nameof(MyFunc2))]
public async Task MyFunc2(
[TimerTrigger("%MyTimerIntervalFromSettings2%")] TimerInfo timer ILogger log)
{
// ...
// ...
FunctionLogicOnTimer("I am triggered from MyFunc2");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With