Have you published a long running web job in Azure and noticed that it has terminated with an ‘Aborted’ status. Chances are that the job has timed out.
In this post I'll explain what's happening here and how you can fix this.
So What’s Going On?
WebJobs run within the context of the parent websites IIS worker process. When the website shuts down, guess what, so does your WebJob!
Microsoft states that Web Jobs running on the Free Tier will timeout after 20 minutes of inactivity, unless you set them to be Always On.
How do I fix it?
If you’ve got a long running process running within your WebJob you’ll need to enable the Always On mode to ensure your WebJob doesn’t get killed after 20 minutes of inactivity of your website hosting your WebJob.
1. Log into the Azure Portal – https://portal.azure.com
2. Open the App Service that your WebJob is running within.
3. Open the APPLICATION SERVICES panel
4. Enable the ALWAYS ON option
If the ALWAYS ON option isn’t enabled for you, chances are that you’re probably on the Free Tier.
You’ll need to upgrade to at least a Basic plan before you can access this feature.