Reputation: 125
I am pulling my hair out trying to get this to work. I have found multiple sources for having a function run once a day. I have tried the following items:
0 0 * * *
0 0 0 * * *
0 0 23 * * *
I have tried other variations, but every time this runs, it will execute multiple times per day with no consistence. For instance, I am using "0 30 1 * * *" thinking it will run once at 1:30AM, so far it has run 4 times at the following intervals:
00:44:19
01:28:46
01:30:00
12:53:21
The times are completely sporadic, only one was on the correct time but where are the other 3 coming from? I have looked on other sites and there appears to be no consistency of format. I have seen a lot using 6 characters, but I've even seen some people use 7 characters (and they referenced this site Freeformatter.com) but if I use 7 characters, the function throws an error.
I'm getting really fed up with the fact all variations I have looked up, hasn't work. Any help would be great.
Upvotes: 0
Views: 647
Reputation: 14088
First, there is only one form of cron expression in azure function timetrigger, that is:
{second} {minute} {hour} {day} {month} {day of week}
Second, other than trigger by the cron expression of your timetrigger, there are two ways to trigger your function.
1, different from blobtrigger, timetrigger dont need actual things. So when you click run on portal, the timetrigger will be triggered.
2, there is a setting in the function.json
that will lead to timetrigger trigger at the time you dont want. It is runOnStartup
. when it is true, timetrigger runtime will start when the function app wakes up after going idle due to inactivity, function changes, and function app scale out.
Let me know whether you problem can be solved.:)
Upvotes: 1