Reputation: 2991
Navigating to App Services in Azure, then navigating to WebJobs, I am able to add a new WebJob. I name it, upload a zip file with the necessary files, and under type, I select triggered
instead of continuous
. For Triggers, scheduled
is selected.
For the CRON expression, I put 0 */5 * * * *
. Sure enough, this WebJob runs every 5 minutes. I can check my WebJob Logs to see their status and that they're returned "successful".
However, when attempting to do the same process but with a different CRON expression, the WebJob never ran.
Yesterday, I uploaded the same exact zip file as above, but with 0 0 5 * * *
as the CRON Expression (Set to run at 5AM every morning).
I checked this morning in my Microsoft Azure WebJobs Logs and under "Last Run Time", the WebJob says Never ran
.
Why is this?
Will the WebJob not run if I'm not logged into Azure to make sure it runs? How can I guarantee this WebJob to be run?
Anyone else having this problem?
Upvotes: 2
Views: 842
Reputation: 26314
All times are UTC as already mentioned here by someone else. If you have something against UTC, you can alter the timezone by setting WEBSITE_TIME_ZONE
application setting as detailed here.
Also make sure you have Always On enabled for the site that hosts the Webjob, otherwise the w3wp.exe
process that is in charge of the crontab won't be around to kick off your job.
For completness's sake, Kudu uses a 6-field cron expression. The 1st field represents seconds rather than minutes (which is the first field in classic crontab).
More here: https://github.com/projectkudu/kudu/wiki/Web-jobs#scheduling-a-triggered-webjob
Upvotes: 6