Preventing Idle Timeout in Triggered Azure WebJobs Jobs

Jared Johnson, 15 May 2017

After setting up a Triggered Azure WebJob, you may run into the confusing error message in the logs after running it of “…aborted due to no output and CPU activity for 121 seconds. You may increase SCM_COMMAND_IDLE_TIMEOUT setting to solve the issue”.

This is confusing as the SCM_COMMAND_IDLE_TIMEOUT setting actually applies to timeouts during deployment, not your WebJob being idle. The correct setting for WebJobs is WEBJOBS_IDLE_TIMEOUT (other WebJob configuration settings can be found here). This should be set in the configuration setting for the Web App, rather than in the App.config of the WebJob. Note that the value is in seconds.


Another solution is to output to the Console, which is especially useful for jobs that are doing long running asynchronous tasks or polling external services. For these cases adding a heartbeat style Console write every minute is better than increasing the Idle Timeout to huge numbers, especially if there are other jobs on the same Web App that would be effected.