I have a Web Job within an Azure website that is being aborted. Its rather long running, taking perhaps 30 mins. It pulls in a lot of data from an Azure SQL database and basically compiles figures used for reporting.
Looking at the output logs it would appear that Azure aborts the job with no warning mid way through execution. There is no indication as to why.
Is there a way to prevent Azure from aborting a Web Job?
The website is hosted within a standard azure website.
Thanks
If you set the web app that hosts your job to run continuously, run on a schedule, or use event-driven triggers, enable the Always on setting on your web app's Azure Configuration page. The Always on setting helps to make sure that these kinds of WebJobs run reliably.
You can monitor Web Jobs using 3rd party tool like CloudMonix or App Insights Web Tests(it is a part of Azure Monitor). With App Insights Web Tests you need Kudu Web Jobs API to get the current status of the web job, e.g. Call the Kudu API from your App Insights Web Tests.
Webjob ...' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed. This error happens if the job uses TimerTrigger. There are two reasons why your job will not get back positive life-tick.
Check the stopping_wait_time
parameter within webjob-publish-settings.json. The value of the parameter is used in seconds. So if you need 30 minutes of execution time before azure aborts it use:
"stopping_wait_time": 1800
Credits here: http://blog.amitapple.com/post/2014/05/webjobs-graceful-shutdown/#.VNqThvmG8oc
regards
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