3

I'm new to Azure so this may be something obvious that I'm missing. I created a new Azure Cloud Service project and added a web role and worker role. In the web role I upload a file to blob storage. That part works fine. As part of that that process I added a message to the azure message queue. In my worker role I'm checking for a message in the queue. The issue is the worker role does not appear to be working. In debug mode I put in a break point and it never gets hit. Is there a step that I am missing that starts the worker role or something?

6
  • 1
    Did you run the Azure cloud project?
    – SLaks
    May 9, 2011 at 1:34
  • I have the Azure cloud project with a web role and worker role. I'm not sure what your question is?
    – daustin
    May 9, 2011 at 11:56
  • Which VS project did you execute?
    – SLaks
    May 9, 2011 at 12:10
  • Probably the web role project. So maybe I need to execute the Azure cloud project. Is that what you are saying?
    – daustin
    May 9, 2011 at 17:01
  • I will try that this evening when I get home. I had a feeling it might be something simple because I saw so many simple examples of using web role and worker role.
    – daustin
    May 9, 2011 at 18:36

3 Answers 3

4

You need to run the Azure project itself, not the individual roles.
This will start all of the roles in the Azure development fabric.

0

Can you share the code for your worker role's OnStart() method. One thing I can think of is that your role's OnStart() method is terminating which should not be happening. There should be an infinite loop inside your worker role's OnStart() method inside which you will need to repeatedly call the function which checks the queue status.

2
  • Thanks for the reply. I will update with my sample later but basically I used the default worker role template so the inifinite loop is in the OnStart method. I put a break point in the loop and it never entered. I thought maybe there was something else that needed to be "wired up" that I didn't know about.
    – daustin
    May 9, 2011 at 11:55
  • 2
    The OnStart() should definitely terminate. The Run() method is the one you never exit from. You must return true from OnStart() or you role will never become responsive.
    – dunnry
    May 9, 2011 at 12:54
0

If you run the Azure project, it will automatically initiates the roles. If you want to debug, then enable intelli trace and debug your application in development fabric.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.