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

Creating an Azure website

Creating an Azure website using  Portal, Powershell and CLI Creating an Azure website on Microsoft Azure Cloud starts with creating ...
Read More

Deployment slots in Azure website

Defining deployment slots in Azure website Deployment slots in Azure website are collection of individual Azure website linked to your ...
Read More

Publishing an Azure website

Publishing an Azure website using various methods For publishing an Azure website, the web application or code needs to be ...
Read More

WebJobs in Azure website

Introduction to WebJobs in Azure website and Deployment using Portal and Powershell Web Jobs in Azure websites are exclusive applications ...
Read More

Azure website settings

Introduction to Configuring the azure website settings The first step you will need to follow for an Azure website is to ...
Read More
Loading...

Practice Tests in this course are

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 1

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

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 2

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

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 3

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

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 4

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

70-533 Implementing Microsoft Azure Infrastructure Solutions Practice Test 5

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