Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Web Sites - scheduled tasks

I am developing a web site which I plan to host on Windows Azure. The site will need to run some daily/weekly scheduled jobs, synchronizing to various 3rd party data sources, sending user notifications, etc. It should also be able to run on-demand async tasks such as sending emails to users etc.

My initial thought was to host this using Azure Cloud Services, with one web role running MVC 4 and one worker role both taking care of scheduled tasks, and pulling async tasks (sending emails etc) out of queue storage. However, this is going to cost me, seeing how I need to pay double for compute hours.

The project might justify this cost in the future, but before business picks up I'd really prefer a cheaper alternative. Therefore I'm looking into Azure Web Sites.

I could cut the cost in half by using Azure Web Sites for the MVC site and having a worker role running the taks, but I'd love to hear about other alternatives, besides the obvious option to manually trigger them from my admin module.

Also, can I connect the site to my domain and use ssl for free using Azure Web Sites?

like image 717
havardhu Avatar asked Jul 06 '13 13:07

havardhu


People also ask

Are Azure WebJobs deprecated?

Azure WebJobs are deprecated, but still in use. They are being phased out in favor of Azure Functions. Azure Functions is a more up-to-date and feature rich service which offers a greater degree of flexibility and control.

What is the difference between Azure functions and WebJobs?

Summary. Azure Functions offers more developer productivity than Azure App Service WebJobs does. It also offers more options for programming languages, development environments, Azure service integration, and pricing. For most scenarios, it's the best choice.

For which Web App can you configure a WebJob?

For which web app can you configure a WebJob? Publishing a . NET Core WebJob to App Service from Visual Studio uses the same tooling as publishing an ASP.NET Core app.


2 Answers

It looks like Azure finally has proper scheduling built in - see the Azure Scheduler documentation

Whilst it's in preview and you'll most likely have to use the REST API for now, I'm sure it won't be long before the functionality is available in the management portal. I've been waiting ages for this!

like image 176
Phil Lee Avatar answered Sep 20 '22 08:09

Phil Lee


If you're comfortable writing code in node.js, do take a look at Windows Azure Mobile Services. It has the capability to define and execute scheduled tasks. More about this can be found here: http://www.windowsazure.com/en-us/develop/mobile/tutorials/schedule-backend-tasks/.

Another alternative could be to use Aditi's Scheduler Service: http://www.aditicloud.com/.

Yet another alternative would be to write your own scheduler and hosting that solution in Azure Websites. I would recommend using Quartz.net scheduling library. It's free, open source and used by many folks.

I still think going Worker Role route for job processing is a viable solution. What you could do is host the front-end infrastructure in a Windows Azure Website and have it communicate to the worker role via Windows Azure queues. Assuming you host 2 instances of worker roles in Extra Small VM size, it's going to cost you about $30.00 per month ($0.02 x 2 x 750 hours). I wrote a blog post on building your own task scheduler and hosting it in a worker role not too long ago. You can read that post here: http://gauravmantri.com/2013/01/23/building-a-simple-task-scheduler-in-windows-azure/

Also, can I connect the site to my domain and use ssl for free using Azure Web Sites?

I don't think so. SSL is not free with Windows Azure Websites. Take a look at SSL pricing here: http://www.windowsazure.com/en-us/pricing/details/web-sites/.

like image 42
Gaurav Mantri Avatar answered Sep 22 '22 08:09

Gaurav Mantri