Scheduling Tasks With Azure Scheduler

In many applications it is necessary to send email notifications on a schedule. There are many ways to achieve this functionality: using a Windows service,  Windows Task Scheduler, or a number of other third party solutions. In our case, we don't have much control over our web server and so we decided against a Windows service. We ended up going with Azure Scheduler which provides a reliable way to hit a network endpoint on a user defined schedule. While not a free solution in most cases, the cost is low for the majority of small applications. Here's how to set up Azure Scheduler:


  1. Open the Azure portal and open the Scheduler Job Collections blade. This can be accessed by searching for scheduler in the top search bar in the Azure portal.


  2. Click Add in the top left corner.


  3. Name the job. The name can only have alphanumeric characters, hyphens, and underscores.
  4. Select or create a new job collection. 
  5. If creating a new job collection, select your pricing tier, resource group, and location. For this example I am using the Free tier but Standard or higher will be required in most applications (auth is not supported in the Free tier). Click OK to create the job collection.
  6. Select the Azure subscription to use.



  7. Configure  the action settings. For this example I am using Http, Get, and the default settings in the optional settings section. The URL is the endpoint the scheduler will access. When you are done click OK.



  8. Configure schedule. I set the schedule to recur once a day at 12:00 AM UTC-4, but Azure supports more advanced schedules. When you are done, click OK.


  9. Click Create. It will take a minute for the job collection to deploy. You may need to refresh to see the new job collection in the list.

That's it! Your job will now run at the frequency you selected. If you want to test the job you can open the job interface and select Run Now. Azure also provides some nice graphics to show the success rate and results of your job actions.

Comments

Popular posts from this blog

IIS Express Client Certificates

ASP.NET Identity Remember Me

Stop Visual Studio from Eating Disk Space