title: How to resolve error when I run WebJob application in Azure? (SCM_COMMAND_IDLE_TIMEOUT,WEBJOBS_IDLE_TIMEOUT)
body: <p>I'm writing a console application that collects data from the websites (doing <strong>scraping</strong>).
  I make a webjob application in Visual Studio and contains my console application there and then I publish it in Azure App Service.</p>
  <p>I tried to change settings in Web.config of my web job by adding</p>
  <pre><code>  &lt;add key=&quot;SCM_COMMAND_IDLE_TIMEOUT&quot; value=&quot;3600&quot; /&gt;
    &lt;add key=&quot;WEBJOBS_IDLE_TIMEOUT&quot; value=&quot;3600&quot; /&gt;
  </code></pre>
  <p>Also, I try to find where I can change the configuration of my web job app in the Azure portal and not really find it.
  reference to post <a href="https://stackoverflow.com/questions/26596968/azure-webjob-timeout-configuration-settings">Azure WebJob timeout configuration settings</a></p>
  <p>This is the error that I received when I run it:</p>
  <pre><code>[08/19/2019 14:16:14 &gt; 5a8697: SYS INFO] Status changed to Running
  [08/19/2019 14:20:16 &gt; 5a8697: ERR ] Command 'cmd /c &quot;&quot;MainApp.ex ...' was 
  aborted due to no output nor CPU activity for 121 seconds. You can 
  increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT 
  if this is a WebJob) if needed.
  cmd /c &quot;&quot;MainApp.exe&quot;&quot;
  [08/19/2019 14:20:16 &gt; 5a8697: SYS INFO] Status changed to Failed
  </code></pre>
  <p>example of scraping code:</p>
  <pre><code>public SiteProcessingResult ScrapeSite(string url, int siteId)
      {
          SiteProcessingResult result = new SiteProcessingResult();
          int count = 0;
          WebClient webRequest = new WebClient();
          webRequest.Encoding = Encoding.UTF8;
          string mainSiteHTML = webRequest.DownloadString(url);
          mainSiteHTML = ScrapeHelper.RemoveComments(mainSiteHTML);
  
          mainSiteHTML = mainSiteHTML.Substring(mainSiteHTML.IndexOf(&quot;&lt;div class=\&quot;wrap content\&quot;&gt;&quot;));
          mainSiteHTML = mainSiteHTML.Remove(mainSiteHTML.IndexOf(&quot;&lt;footer&quot;));
  
          string depReg = string.Format(&quot;{0}.*?{1}&quot;, &quot;&lt;div class=\&quot;row\&quot;&quot;, &quot;@example.org&lt;/span&gt;&quot;);
          MatchCollection matchList = Regex.Matches(mainSiteHTML, depReg, RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.Singleline);
  
          foreach (Match match in matchList)
          {
              string articleUrl = GetArticleUrl(match.ToString(), url);
              string title = GetArticleTitle(match.ToString());
              string organization = &quot;&quot;;
              string date = &quot;&quot;;
              string locationString = GetLocationFromArticle(match.ToString());
              string content = GetContentFromArticle(match.ToString());
              string state = GetState(locationString);
  
              SitePost record = SitePost.CreateSiteRecord(date, content, title, articleUrl, jobTitle, organization, locationString, state, null, CultureInfo.CreateSpecificCulture(&quot;en-US&quot;));
              result.Records.Add(record);
          }
  
          return result;
      }
  </code></pre>
  <p>example of sending mail:</p>
  <pre><code> public void SendEmail(SiteTypeEnum siteType, string subject, string message, bool isHtml = false, string sendTo = null)
      {
          string userName, password, to;
          GetEmailLoginDetails(siteType, out userName, out password, out to);
          if (sendTo == null)
          {
              sendTo = to;
          }
          LoggerHelper.WriteInfo(&quot;Send email, phase {0}, username {1}, password {2}, to {3}, subject {4}&quot;, siteType, userName, password, sendTo, subject);
          Logic.Helper.EmailGoogle.SendMessage(sendTo, string.Empty, string.Empty, subject, message, isHtml, null, userName, password, userName, userName);
          //SendEmailDev(phase2, subject, message, isHtml);
      }
  </code></pre>