Introduction to WebJobs in Azure website and Deployment using Portal and Powershell

Web Jobs in Azure websites are exclusive applications or writings running in the contextual of the Azure website as a background task. Below we have listed the files supported by Web Jobs as runnable tasks

  • .cmd, .exe, .bat (using a Windows command prompt)
  • .ps1 (using Windows PowerShell)
  • .sh (Bash)
  • .php
  • .py (Python)
  • .js (Node)

You can configure a Web Job as consistently functioning, scheduled task and on-demand basis.

Deploying an Azure WebJob using the management portal

By zipping and deploying application or writing as a .zip file with a maximum file size of 100 MBs, you can deploy a Web Job using the management portal. If you are deploying Web Job either on consistently running task or on-demand, all you have to do is specify the name of the Web Job as well as the path to the zip file. On the other hand, if you intend to deploy Web Job as a scheduled task, you will be given with a choice of configuring it as a one-time task or or Continuously Running or repetitive job. In case of a periodic job, you are allowed to set the granularity of the plan to be as small as few minutes and as large as months. Figure 1 illustrates a job that can be configured to operate after every half an hour.

WebJobs in Azure website 1

FIGURE 1 Define a WebJob to run every 30 minutes

Deploying an Azure WebJob using Azure PowerShell

For deploying a Web Job by using Azure PowerShell, you need to use the New-AzureWebsiteJob cmdlet as demonstrated below:

$wjPath = "E:\Contoso-WebJob.exe"
$wjName = "Contoso-WebJob"
New-AzureWebsiteJob -Name $wsName -JobName $wjName -JobType Triggered -Slot $wsStaging
-JobFile $wjPath

The New-AzureWebsiteJob cmdlet is capable of supporting two types of jobs including triggered and continuous jobs. The triggered jobs are similar to the on-demand tasks. Though the JobType limitations can’t assist scheduled Web Jobs.

This article is a part of 70-533 Implementing Microsoft Azure Infrastructure Solutions Prep course.

More Articles included in this course are

article

Custom domain for Azure website

Configuring a custom domain for Azure website Azure websites are distributed to the common azurewebsites.net domain. If your website title ...
Read More
article

SSL certificates for an Azure website

Configuring SSL certificates for an Azure website Azure website fully supports SSL certificates by default. For example, if your website ...
Read More
article

Azure Traffic Manager

Configuring Azure Traffic Manager Azure Traffic Manager refers to a network service which can be used to route users to ...
Read More
article

Handler mappings configuration for an Azure website

Configuring handler mappings It is essential to configure the added handlers or interpreters to assist the website code in accordance ...
Read More
article

Virtual applications and directories for an Azure website

Configuring virtual applications and directories for an Azure Website There are certain websites which may require virtual applications or directories ...
Read More

Practice Tests in this course are

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 6

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 6 This page shows the instructions for Exam 70-533 ...
Read More

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 7

Instructions for Exam 70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 7 This page shows the instructions for Exam 70-533 ...
Read More