2
votes

I am reaching a conflict in my azure project, I'm trying to seclude task : on every 16th of the month of .xml file form individual web site.

In my project I have one web role and one worker role, I trying to seclude on every 16th of the month that the web role will create a message(connect to the site and download the .xml file), insert it to the queue storage, the worker role gets the message process it and delete the message.

Suggestion anyone??

3
brbrbrbrbrbbrbrr :) Could you explain it better pls?DmitryBoyko
i want that one of the tasks of the web role is to automatic create message to the queue and the worker role will need to procees it.Hezi Rofe
Your question is a little confusing. You say that you want the web role to 'create a message(connect to the site and download the .xml file). Why would you have a web role connect to itself? That seems strange.CodeThug

3 Answers

4
votes

Have you taken a look at this post - http://blog.smarx.com/posts/building-a-task-scheduler-in-windows-azure? It discusses one approach for building a task scheduler, which seems pretty much like what you're looking to do.

2
votes

In your worker role you can start a timer or use this: http://quartznet.sourceforge.net/

2
votes

An Azure web role is a windows server, and as such has a task scheduler built in, just like any other windows server. You can use a startup task to add a scheduled task to the task scheduler on a web or worker role which will then be fired on the 16th of every month.

However, keep in mind that if you have multiple web roles / worker roles, each one will have this scheduled task set up. So you'll need to have some way of knowing if another role has taken care of the work yet or not, or the scheduled task will run once for each web role.