Azure WebJob timeout configuration settings
Solution 1
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.
Solution 2
Login to Microsoft Azure portal
Go to App Services,
Select your website
Go to settings --> Application settings tab
Create a key “WEBJOBS_IDLE_TIMEOUT” under App settings section
Save
Solution 3
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
Related videos on Youtube
Ender2050
Updated on January 28, 2020Comments
-
Ender2050 over 4 years
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.
-
Anthony Chu over 9 yearsInstead 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). -
Ender2050 over 9 yearsOk, 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?
-
Amit Apple over 9 yearsYou 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.
-
Esben Skov Pedersen about 9 years@AmitApple Is it still the case that we cannot set this in a configuration file? i.e. the .deployment file?
-
Amit Apple about 9 yearsYes, if you need this please open an issue - github.com/projectkudu/kudu/issues
-
Rob Reagan almost 7 years@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.
-
-
LatentDenis over 7 yearsWhat do you put for the Value?
-
LatentDenis over 7 yearsAny Particular
Value
to add with this key? Does it adhere to a perticular format? like00:10:00
for 10 minutes? -
Zain Rizvi over 7 years@VolcovMeter I just updated my answer with the format
-
youngseagul over 7 yearsYou have to put value in seconds, best option is that you put that interval of time after which web job will run again , so that web job should not crash in the time of waiting. Suppose your web job runs after each hour then put 3600 in text box of value.
-
chaitanyasingu about 2 yearsHaving the same issue. Tried above steps but my points is - Is it good idea to keep it Running state. I mean if we give 3600 seconds, the web job is in running state. but the job done or the execution time is 10 mins.