Azure Web Jobs Complete Reference|Webjobs Tutorial
Azure Web Jobs are process that runs in background and do certain tasks. Azure WebJobs are 3 types.
1. Azure Manual Web Job or On Demand WebJob
2. Azure Scheduled Web Job or Azure Triggered WebJob
3. Azure Continuous WebJob
Webjobs are alternative for scheduled console applications or .Net Core Windows services. Azure Web jobs can be long running or short running.
-----------------------------------------------------------------------
Azure Manual Web Job or On Demand Web Job is a job which is deployed as azure web job and it can only be started manually. Azure Manual Jobs are also called as On Demand jobs as we run it manually as and when it is needed.
Azure Scheduled Webjobs are the jobs which runs on a scheduled time. The schedule has to be mentioned with a CRON expression. CRON expression will have 6 place holders ranging from seconds to day of week. Azure Scheduled webjobs are singleton. i.e At a time only one instance of Azure Web Job will be run.
Azure Continuous Web Jobs are the jobs which runs continuously 24*7. Azure Continuous Web jobs can be scaled to run multiple instances.
---------------------------------------------------------------------
Issues with Azure Web Jobs
Azure Web Job Aborted - This can happen when the web job is idle for more than 121 seconds or not writing the out put to the console. To fix this issue we have to add SCM_COMMAND_IDLE_TIMEOUT. This will prevent stopping of the web job when not writing the output to the console. We need to add webJOBS_IDLE_TIMEOUT too. This will prevent the job from not stopping because of sitting idle and there is no CPU usage. This can happen when there is any blocking operation like stored procedure. These two values has to be set in Azure App Service -- Configuration tab -- Application Settings.
Azure App not found - This can happen when "Always on" flag is not turned on for the app service. If "Always on" is false and there are not incoming requests to azure app service for long the app will be unloaded and the same will happen with the web job too. To prevent this issue we need to set "Always On" setting. This value can be set in Azure App service --Configuration--General Settings.
Azure Scheduled Web Job not ran - Azure Scheduled Webjobs will run in UTC time zone. If you want to change it, you can change it in the app service configuration.
---------------------------------------------------------------
In this demo, I have shown hands on demo on Azure App service continuous webjobs, Azure App Service scheduled web jobs and Azure on Demand or manual web jobs.
Links:
settings.job reference - https://docs.microsoft.com/en-us/azur...
NCRON Tab Expressions - https://docs.microsoft.com/en-us/azur...
Chapters
00:00 Introduction on Azure Web Jobs
00:31 Creating Azure App Service
01:10 Azure On Demand or Manual Webjobs Tutorial
02:33 Azure Scheduled Webjobs Tutorial
05:58 Azure Continuous Webjobs
#AzureWebJobs#
#AzureWebJobsComplete#
#AzureAppServiceWebJobs#