Azure WebJobs provide an easy way to run scripts or programs as background processes in the context of an App Service web app, API app, or mobile app. You can upload and run an executable file such as:
- .cmd, .bat, .exe (using Windows cmd)
- .ps1 (using PowerShell)
- .sh (using bash)
- .php (using PHP)
- .py (using Python)
- .js (using Node.js)
- .jar (using Java)
These programs run as WebJobs on a schedule (cron) or continuously.
You can use the WebJobs SDK is to simplify the code you write for common tasks that a WebJob can perform, such as image processing, queue processing, RSS aggregation, file maintenance, and sending emails. The WebJobs SDK has built-in features for working with Azure Storage and Service Bus, for scheduling tasks and handling errors, and for many other common scenarios.
Azure WebJobs SDK
Creating a WebJob in the Azure Portal
- In the Web App blade of the Azure Portal, click All settings > WebJobs to show the WebJobs blade:
- Click Add. The Add WebJob dialog appears.
- Under Name, provide a name for the WebJob. The name must start with a letter or a number and cannot contain any special characters other than ”-” and ”_“.
- In the How to Run box, choose your preferred option Continuous or Triggered (the trigger can be using a cron schedule or a WebHook).
- In the File Upload box, click the folder icon and browse to the zip file that contains your script. The zip file should contain your executable (.exe .cmd .bat .sh .php .py .js) as well as any supporting files needed to run the program or script.
- Check Create to upload the script to your web app.
The name you specified for the WebJob appears in the list on the WebJobs blade.