Deep joy working with Azure Function apps, and using timer triggers this last few weeks.
I’ve been working on a set of Azure Functions that fire on a schedule, to read information from across the Azure environment, and write the results to Cosmos DB. Simple enough.
The trigger is set as a Timer:
The timer takes an NCRONTAB format for when it fires.
The various pieces of documentation are pretty clear, and I’ve got a lot of familiarity with CRON running on Linux.
My initial schedule was 0 0 */8 * * * – which should fire every 8 hours.
Instead – some really variable and unreliable results. I found "8-ish" hours between triggers to be best case, often the whole function stopped firing. Restart the function, and "8-ish hours" later it fired.
After a bunch of reading and testing, I changed the schedule to 0 0 0/8 * * * – which fires at 00Z, 08Z, 16Z – so every 8 hours, but locked to midnight, 8.00am and 4.00pm UTC.
So far – so good.
This was a good NCRONTAB expression tester: NCrontab Online Expression Tester Evaluator (swimburger.net)
Recent Comments