1
votes

I have a Azure Scheduled Web Job on Azure WebApp. Inside web job, it downloads the excel file from azure blob and read (25 - 30 k records in a file), then it iterate through loop to insert's records in database. Now, when we schedule (Schedule time: 18 hrs) first time the job ran successfully and processed all records from file without any interruptions (between this time site was accessing). But, next time it fails (Aborted) without any reason (No one was accessed site. may be in idle state).

WebJob Abort Status

There is no any indications when i looked into logs. However, first schedule ran successfully and shows success status later all are in Aborted status, Why?

Success

Also done with below settings in webapp:

stopping_wait_time - 3600
WEBJOBS_IDLE_TIMEOUT - 3600
SCM_COMMAND_IDLE_TIMEOUT - 121

1
Do you have Always On enabled for the site hosting the WebJob? If there's no traffic to the site for like 20 minutes or so the application pool hosting the WebJob could get unloaded.evilSnobu
No, as i have been using MS Network Partner subscription there is no way to enable it. However, the webjob is running while site is in use or accessing someone.Harshal Yelpale
The setting is tied to the pricing tier you're using not subscription type. You definitely need to turn that On to make this reliable.evilSnobu

1 Answers

1
votes

Per Azure's documentation,

Always On. By default, web apps are unloaded if they are idle for some period of time. This lets the system conserve resources. In Basic or Standard mode, you can enable Always On to keep the app loaded all the time. If your app runs continuous web jobs, you should enable Always On, or the web jobs may not run reliably.

So there is no promise from Azure Web Apps for your WebJob to continue running more than 20 minutes. If you need to rely on that you'll need to enable Always On. To enable it. See below.

  1. In the Azure Portal, navigate to your App Services.
  2. Click Application Settings in the SETTINGS menu.
  3. Turn Always On to on, then click Save.

Here the picture:

enter image description here

If you are using the free tier of Azure, maybe this thread will help you: How can I keep my Azure WebJob running without "Always On".