azure-webjobs

Long running Triggered WebJob Aborted by Azure with SCM_COMMAND_IDLE_TIMEOUT setting too


I have a triggerd web job which is a console application. I deployed it by zipping the Debug folder of Console App. My Job has to run till it finished. I don't see any error and after 1 or 2 hours it get aborted. I put SCM_COMMAND_IDLE_TIMEOUT as 36000 in App Setting of App Service and this is Slot Setting. It is still aborting.. I searched here and found that we need Console.Write for web jobs. I have logging in my WebJob which logs using both System.Trace.TraceInformation and Console.Write as well. Still it aborts.

could anyone please help me why my job is still Aborting.


Solution

  • I'd suggest going into your Web App that is hosting your WebJob and add an entry for WEBJOBS_IDLE_TIMEOUT (not SCM_COMMAND_IDLE_TIMEOUT) under the Application Settings blade's App settings section. This is the time, in seconds, until Kudu will kill a WebJob that hasn't had any requests or output in the given time period. Set it to something obscenely high. It only applies to triggered WebJobs. You can read the docs about it here.