Learn how to deploy an Azure WebJob—including common tasks and supported file types—and how to configure a schedule for the WebJob to run on.
- [Narrator] WebJobs are programs or scripts that you're going to run against a web app, and you may be wondering why would we use these? Well these are great for common tasks such as image processing. Let's take an example of you having a buy and sell website. And in this buy and sell website a user can upload an image to the site. But do you want to go ahead and manually convert all those images to thumbnails? Probably not. This is where you'd use a WebJob. And that WebJob would go ahead, take all those images, and then convert them all to thumbnails for you.
WebJobs can also be used for processing our queues, or file maintenance such as removing backup files or old log files. And finally, for RSS aggregation. As I've already mentioned, WebJobs run programs or scripts that you can configure. You can run them on demand, sometimes you'll see this referred to as triggered, or you can run them continuously and on a schedule. There are only certain file types that you can use for your programs and scripts for your WebJobs. These include a .cmd, .bat files or .exe's.
Ps1 files or power shell. .sh files which is bash shell. You can use php or a .py, which is for your Python scripts. Js for node.js and finally .jar for java archives. Now that we've actually talked a little bit about WebJobs, let's go ahead and configure one within Azure. Next we have triggers, these can either be scheduled, or manual. In the case of a manual trigger, you'll need to call a web hook that will integrate into Azure Scheduler.
I'm going to go ahead and select Scheduled. In this case I'm going to use a CRON Expression in order to schedule when a WebJob will run. As a quick refresher, the CRON Expression is in the sequence of second, minute, hour, day of month, month, and day of week. So I'm going to go ahead and enter in an expression here of 0 15 13 * * *, which translates into 1:15 every day. This means that our WebJob will be run at 1:15 every day.
At this point, you'd go ahead and click Okay. And that's all there is to it to configuring a WebJob in Azure WebApps.
Learn the intermediate-level skills needed to design Azure web and mobile apps for any organization, using the Azure Web Apps and Mobile Apps services. Instructor Sharon Bennett, a Microsoft Certified Solutions Expert, covers securing mobile and web apps with Azure Active Directory, creating WebJobs to script tasks such as queue processing and file maintenance, and extending mobile apps with custom code. Plus, learn how to update, back up, and restore your Azure apps.
As an intermediate-level course, an existing understanding of the Azure platform is required. After completing the training, IT professionals will also be better prepared for Azure certification.
- Create Azure web apps
- Create WebJobs
- Using Traffic Manager
- Adding a CDN to web apps
- Updating, backing up, and restoring Azure Web Apps
- Deploying Azure mobile apps