title: Azure Web Job always Failed
body: <p>I have this Azure WebJob function that runs every Saturday. But the Azure function always tagged as Failed but the Job runs successfully when finished as I checked the log.</p>
  <p>Already increase WEBJOBS_IDLE_TIMEOUT and SCM_COMMAND_IDLE_TIMEOUT in Configuration but still tagged as Failed. But still got this error.</p>
  <blockquote>
  <p>Command 'cmd /c &quot;&quot;Software.. ...' 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.</p>
  </blockquote>
  <p>The number of data to be processed is unpredictable, it depends the number of users inputted the values, so the processing time would be between 1 to 40 minutes, 1 minute for least data and 40 minutes for larger data.</p>
  <p>I'm currently using the latest version of WebJob SDK.</p>
  <p><a href="https://i.stack.imgur.com/V4Yp4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V4Yp4.png" alt="Image" /></a></p>
  <p>Here's the code snippet.</p>
  <pre><code>public class ProcessDataFunction
  {
      private readonly IProcessData _processData;
  
      public ProcessDataFunction(IProcessData processData)
      {
          _processData = processData;
      }
  
      [Singleton]
      public async Task ProcessDataMessage([TimerTrigger(&quot;0 0 12 * * 6&quot;, RunOnStartup = true)] TimerInfo myTimer, ILogger logger, CancellationToken cancellationToken)
      {
          logger.LogInformation(&quot;Long running Job Started...&quot;);
  
          var dateSync = DateTimeOffset.UtcNow;
  
          await _processData.ProcessAsync(cancellationToken, dateSync);
  
         logger.LogInformation(&quot;Long running Job Finished...&quot;);
      }
  }
  
  class Program
  {
      static async Task Main()
      {
          var builder = new HostBuilder();
          builder.ConfigureWebJobs(b =&gt;
          {
              b.AddTimers();
              b.AddAzureStorageCoreServices();
  
          });
          builder.ConfigureLogging((context, b) =&gt;
          {
              b.AddConsole();
          });
          builder.ConfigureServices((context, services) =&gt;
          {
              services.ConfigureHttpClients(context.Configuration)
                  .ConfigureDataProcessor()
                  .ConfigureDbContext(context.Configuration);
          });
          
          var host = builder.Build();
          using (host)
          {
              await host.RunAsync();
          }
      }
  
  }
  </code></pre>