An Azure Function must run every 10 minutes indefinitely starting at 00:59:59 (hour, minute, seconds). The cron schedule I am using is unsuccessful.
I am using a Javascript Azure Function based on a timer, e.g.,
module.exports = async function (context, myTimer) {
var timeStamp = new Date().toISOString();
I don't believe there is a setting within an Azure Function to set a start date/time. The cron scheduler seems like the only option.
According to the Azure Functions documentation:
The schedule expression is a CRON expression that includes 6 fields:
{second} {minute} {hour} {day} {month} {day of the week}Note that many of the cron expressions you find online omit the {second} field, so if you copy from one of those you'll have to adjust for the extra field.
Examples provided by the documentation:
To trigger once every 5 minutes:
0 */5 * * * *To trigger at 9:30 AM every day:
0 30 9 * * *
59 */10 * * * * results in these execution times:
- Result: 11:40:59 | Desired: 11:39:59
- Result: 11:30:59 | Desired: 11:29:59
- Result: 11:20:59 | Desired: 11:19:59
- Result: 11:10:59 | Desired: 11:09:59
59 */10-1 * * * * is not supported.
The reason the Azure Function needs to start its initial run at 00:59:59 is that the function compares event timestamps that occurred in the previous 10 minutes to a 10-minute UTC time interval. If any event timestamps to the minute level match a the UTC timestamp within the interval to the minute level (e.g., 2018-12-21Txx:3x:xx.xxxZ of the event at 2018-12-21T00:35:18.894Z matches any UTC timestamp of this pattern 2018-12-21Txx:3x:xx.xxxZ), an action is performed.)
I am stuck. Any help is appreciated. Thank you.