Introduction
This article shows how to deploy WebJobs by using the Azure portal to upload an executable or script.
WebJobs in Azure |
Getting Started
The following steps help to create WebJobs in the Azure portal. Before that make sure that you have an account in the Azure portal with sufficient rights to create. Also, keep ready your application files in a zip format(zip file that contains your executable or script file as well as any supporting files needed to run the program or script.)
Steps to Create Azure WebJobs
In the Azure portal, go to the App Service page of your App Service web app.
Search the WebJobs and select it.
On the WebJobs page, select Add.
Use the Add WebJob settings as specified in the table. Settings detail are given below of this article.
Enter the name of your WebJob.
Upload your zip file.
Select the type of WebJob.
Select scale type, note that the Multi-instance is available only for Continuous WebJobs. Determines whether the program or script runs on all instances or just one instance.
Azure App Service Web Jobs Click OK. Your WebJobs will be listed out in the WebJobs window
To stop or restart a continuous WebJob, right-click the WebJob in the list and click Stop or Start.
What is Azure WebJobs?
Azure WebJobs is a feature of Azure App Service that enables you to run a program or script in the same instance as a web app, API app, or mobile app. There is no additional cost to use WebJobs.
It helps process background jobs like the script to run in the background at scheduled intervals. It is a job that can be scheduled to run periodically. Along with scheduled intervals, WebJobs can be triggered in response to an event, for example, whenever new messages are added to the message queue or a new file is created in a particular directory.
The developers don’t have independent control over how and when WebJobs should be scaled out as it is run as a part of the Azure app service and scales up and scales out as a part of the app service but not independently.
Type of WebJobs
There are two type os WebJobs that are given below
Continuous :Starts immediately when the WebJob is created. To keep the job from ending, the program or script typically does its work inside an endless loop. If the job does end, you can restart it.Runs on all instances that the web app runs on. You can optionally restrict the WebJob to a single instance. Supports remote debugging.
Triggered:Starts only when triggered manually or on a schedule. Runs on a single instance that Azure selects for load balancing. Doesn't support remote debugging.
Add WebJobs settings
- Name:- A name that is unique within an App Service app. Must start with a letter or a number and cannot contain special characters other than "-" and "_".
- File Upload:- A .zip file that contains your executable or script file as well as any supporting files needed to run the program or script. The supported executable or script file types are listed in the Supported file types section.
- Type:- The WebJob types are described earlier in this article.
Summary
In the above of this artcile, we learned what is Azure WebJobs, type of webjobs and how to create it. I hope you have enjoyed it a lot.
Thanks