2

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?

4

1 回答 1

6

正如其他人在这里已经提到的那样,所有时间都是UTC。如果您对 UTC 有异议,您可以通过设置WEBSITE_TIME_ZONE应用程序设置来更改时区,详见此处

还要确保为托管 Webjob 的站点启用了Always Onw3wp.exe ,否则负责 crontab 的进程将无法启动您的工作。

Azure 门户 → 您的 Web 应用程序 → 应用程序设置 → 始终开启

永远在线

为了完整起见,Kudu 使用6 字段cron 表达式。第一个字段表示而不是分钟(这是经典crontab 中的第一个字段)。

更多信息:https ://github.com/projectkudu/kudu/wiki/Web-jobs#scheduling-a-triggered-webjob

于 2016-09-22T14:33:33.607 回答