I have a function app with a time trigger that should run once per night. The function looks similar to this:
[FunctionName("XName")]
public async Task RunAsync(
[TimerTrigger("0 0 0 * * *", RunOnStartup = false)]
TimerInfo myTimer)
{
...
}
Due to some reasons, this function can be needed to be disabled for some days and then enabled again. However, even if I have set RunOnStartup
to be false
, the function get triggered directly even if I have enabled it at 09.00 AM.
I want to stop that, what should I do?
P.S. I don't want to change in the Cron expression because there are no specific days or specific pattern for when the function should be disabled. It is quite a random thing.