Azure WebJob timeout configuration settings

29,555

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

  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

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

Share:
29,555

Related videos on Youtube

Ender2050
Author by

Ender2050

Updated on January 28, 2020

Comments

  • Ender2050
    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
      Anthony Chu over 9 years
      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).
    • Ender2050
      Ender2050 over 9 years
      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?
    • Amit Apple
      Amit Apple over 9 years
      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.
    • Esben Skov Pedersen
      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
      Amit Apple about 9 years
      Yes, if you need this please open an issue - github.com/projectkudu/kudu/issues
    • Rob Reagan
      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
    LatentDenis over 7 years
    What do you put for the Value?
  • LatentDenis
    LatentDenis over 7 years
    Any Particular Value to add with this key? Does it adhere to a perticular format? like 00:10:00 for 10 minutes?
  • Zain Rizvi
    Zain Rizvi over 7 years
    @VolcovMeter I just updated my answer with the format
  • youngseagul
    youngseagul over 7 years
    You 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
    chaitanyasingu about 2 years
    Having 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.