WebJobs is a feature of Azure App Service that enables you to run a program or script in the same context as a web app, API app, or mobile app. There is no additional cost to use WebJobs.
Azure WebJobs can run continuously, on demand or on a schedule.
Azure WebJobs can be created using the following scripts,
- .cmd, .bat, .exe (using windows cmd)
- .ps1 (using powershell)
- .sh (using bash)
- .php (using php)
- .py (using python)
- .js (using node)
This article demonstrates the use of c# command line app.
Step 1
Click File > New Project, and then in the New Project dialog box click Cloud > Azure WebJob (.NET Framework).
Step 2
A console application is created. Right-click the Console Application project in Solution Explorer, and then click Publish as Azure WebJob.
Step 3
The Add Azure WebJob dialog box appears, with the project selected in the Project name box. The Add Azure WebJob dialog lets you enter the WebJob name and run mode setting for your WebJob. Complete the Add Azure WebJob dialog box, and then click OK.
Step 4
Select a publish target, in this example the target will be a Microsoft Azure App Service (Azure web app).
Step 5
We are selecting existing ASP.Net azure web app. You can also create a new web app.
Step 6
Once you click OK. It will populate all the connection details of selected web app. If you want you can validate connection by clicking on ‘Validate Connection’ button
Step 7
Click on ‘Next’ button to see configuration setting. It can be Debug or Release. Click on Publish button to publish this web job.
Step 8
To see webjob associated with your web app, type web in search box and select ‘WebJobs’ as shown below.
Step 9
Now you can see your WebJob with all the details.