I have an issue where an Azure WebJob I created (on a Web App) is not running using the cronjob Trigger I specified. I am able to click on the WebJob, then click Run and it does run fine with no errors. A screenshot of the WebJobs in the portal is shown below.
As you can see, the Trigger is set to run at 9:30 AM every day, but it is never run automatically as per the trigger, only manually using Run. The WebJob itself is set to run a .exe which is contained inside a .zip.
Here are the settings I used when creating the WebJob.
In that article I noted that "In order to guarantee to run your WebJobs successfully, your Web App needs to be Always On." If you run an Azure Web App in the free tier, it will stop running after about twenty minutes and will restart automatically the next time you visit the site.
Got to the Azure Portal, select your web app, choose the WebJobs blade and click +Add. Give the job a suitable name (I called it self-keepalive ), upload self-keepalive.ps1, set it to be Triggered and Scheduled and enter 0 */5 * * * * as the CRON Expression (which will run every five minutes).
A screenshot of the WebJobs in the portal is shown below. As you can see, the Trigger is set to run at 9:30 AM every day, but it is never run automatically as per the trigger, only manually using Run. The WebJob itself is set to run a .exe which is contained inside a .zip.
Upload self-keepalive.ps1 as a WebJob and set it to run every five minutes via the CRON trigger 0 */5 * * * *. Add any other WebJobs you want to run (e.g. self-web-keepalive.ps1 if you want to keep your free Web App running continuously).
You need to make sure you have Always On enabled in your App, which requires it to run in Basic or higher mode.
See https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/#CreateScheduledCRON for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With