WebJob And Its Types In Azure

Introduction

In this article, I will discuss web jobs and their types in Azure.

Azure web job is like a service that can run a task in the background. It doesn’t contain any user interface and it is the same as our Windows service.

The scenarios where we use Azure web jobs are

  • Image processing or other CPU-intensive background work.
  • Queue processing.
  • File maintenance, such as aggregating or cleaning up log files.
  • Long-running tasks such as sending emails.

Types of web job

There are 3 types of web jobs such as

  • Continuous web job
  • Manual triggered web job
  • Scheduled triggered web job

Continuous Web job

In a continuous web job, once the web job is created it keeps on running all the time.

Below, I will explain how to create a continuous web job.

  • Login into your Azure account with proper credentials.
  • Go to app services and click on the particular app service that you want to select.
  • Go to web jobs.
  • Click on add and a new popup will come from the right-hand side.
  • In the popup, add a name, upload a zip file (zip file of our console application), select type as continuous and select scale as multi-instance/ single instance, and click on ok which is shown in the below figure.
    Webjobs

It will take some time to create the web job and after that, the web job will show under the web jobs section.

Manually-triggered Web job

In manually-triggered web jobs, once the web job is created we need to manually trigger the job in the portal.

Below I will explain how to create a manually-triggered web job.

  • Login into your Azure account with proper credentials.
  • Go to app services and click on the particular app service that you want to select.
  • Go to web jobs.
  • Click on add and a new popup will come from the right-hand side.
  • In the popup, add a name, upload a zip file (zip file of our console application), select type as triggered select triggers as manual, and click on ok which is shown below figure
    Click on ok

It will take some time to create the web job and after that, the web job will show under the web jobs section.

Scheduled Triggered Web Job

In a scheduled triggered web job, once the web job is created it will trigger automatically.

Below I will explain how to create a scheduled triggered web job.

  • Login into your Azure account with proper credentials.
  • Go to app services and click on a particular app service that you want to select.
  • Go to web jobs.
  • Click on add and a new popup will come from the right-hand side.
  • In the popup, add a name, upload a zip file (zip file of our console application), select type as triggered, select triggers as scheduled, and select cron expression as “00****”(which means we set the web job for 1 hour) and click on ok which is shown in the below figure.
    All resources

It will take some time to create the web job and after that, the web job will show under the web jobs section.

After every 1 hour (or whatever the time set in the cron expression), the web job will run automatically.


Similar Articles