Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Long running Web Job being aborted by Azure

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

like image 642
Sergio Avatar asked Jan 14 '15 09:01

Sergio


People also ask

Which Azure websites feature should you enable for continuously running WebJobs?

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.

How do I monitor my Azure web job?

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.

What was aborted due to no output nor CPU activity for 120 seconds?

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.


1 Answers

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

like image 176
Juan Simon Avatar answered Sep 23 '22 05:09

Juan Simon