Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
WebJobs in Azure App Service let you run scripts or programs as background tasks. In this quickstart, you create a scheduled WebJob that prints the current time, using a prebuilt script for either Windows or Linux.
Prerequisites
- An Azure account. Create an account.
- An existing App Service app running on your preferred OS:
- Windows App Service (any stack: code or container)
- Linux App Service (any stack: code or container)
- Enable Always On in the App Service settings: Configure Always On
- For Windows containers and all Linux apps, set the app setting
WEBSITE_SKIP_RUNNING_KUDUAGENT = false
Download a sample WebJob
Choose the version that matches your App Service OS:
Platform | Download link | Included script |
---|---|---|
Windows | Download CMD version | run.cmd (uses echo %date% %time% ) |
Linux | Download Bash version | run.sh (uses date ) |
Each zip contains a single script that prints the current system date and time.
Add the WebJob in the Azure portal
In the Azure portal, go to your App Service app.
In the left menu, select WebJobs > + Add.
Fill in the form with the following values:
Setting Value Name webjob
File Upload The .zip
file you downloadedType Triggered
Triggers Scheduled
CRON Expression 0 0/1 * * * *
Select OK to create the WebJob.
Verify the WebJob
- Go to the WebJobs tab.
- Select your WebJob and open Logs.
- Confirm that it runs every minute and prints the system time.
Clean up
To remove the WebJob, select the WebJob in the portal and select Delete
.
Next step
Build a custom scheduled WebJob from scratch using .NET, Python, Node.js, Java, or PHP