26
votes

We have an Azure web site with a daily scheduled job. In our case, the scheduled job runs a stored procedure that takes about 10 minutes so there is no local processing. Our web job is terminating after about 4 minutes with this error.

Command 'cmd /c ...' aborted due to no output and CPU activity for 121 seconds.
You may increase SCM_COMMAND_IDLE_TIMEOUT setting to solve the issue.

We've tried adding the following app settings to the web job's app.config file:

<appSettings>
    <add key="SCM_COMMAND_IDLE_TIMEOUT" value="100000" />
    <add key="WEBJOBS_IDLE_TIMEOUT" value="100000" />
</appSettings>

Those files are referenced in this document https://github.com/projectkudu/kudu/wiki/Web-jobs but they don't seem to have any effect. (still timing out after adding the settings to the app.config file)

Are we adding the configuration settings to the right place?

Thanks for the help.

3
Instead of adding it to the app.config, try logging into the management portal and adding the SCM_COMMAND_IDLE_TIMEOUT app setting to the configure tab. (Can also do this via Visual Studio by right-clicking the website in Server Explorer and selecting View Settings).Anthony Chu
Ok, this does work - thanks. But I need to find a way to get it checked into source control and working through the .config files. Do you know if the settings should be configured for the website or the web job?Ender2050
You can't have a committed file for this configuration, you can open a feature request for this here: github.com/projectkudu/kudu/issues as a workaround try Console.WriteLine(".") every minute.Amit Apple
@AmitApple Is it still the case that we cannot set this in a configuration file? i.e. the .deployment file?Esben Skov Pedersen
@Ender2050, I know this is old but wanted to make sure that you're aware of ARM templates. You can include the SCM_COMMAND_IDLE_TIMEOUT as a setting within your Web App's ARM template, and then check the template into source control. Let me know if you need more details.Rob Reagan

3 Answers

18
votes

You need to set SCM_COMMAND_IDLE_TIMEOUT from the portal to your desired timeout value in seconds. For example, set it to 3600 for a one hour timeout.

Go to your website's config section, find the app settings section, and add the setting.

15
votes
  1. Login to Microsoft Azure portal

  2. Go to App Services,

  3. Select your website

  4. Go to settings --> Application settings tab

  5. Create a key “WEBJOBS_IDLE_TIMEOUT” under App settings section

  6. Save

2
votes

As this is the first stack overflow error that comes up when searching for the timeout problem i want to update it from my perspective;

If expecting a CONTINUOUS webjob, this isn't something that happens by default (Even though the webjob appears to run by the rules until timeout). This is something that has to be selected in the Visual Studio Publish properties as detailed here:

https://docs.microsoft.com/en-us/azure/app-service/webjobs-dotnet-deploy-vs

Once continuous is selected and the webjob is published, this error goes away