0

I am having difficulty finding info about what Worker role actually is. For example Web role is an asp.net web application that is automatically deployed and configured in IIS. You can see the application files in IIS. Where can I see the Worker role file? Is it a windows service? Also who is running the Worker role process?

user1561202
  • 145
  • 1
  • 9

1 Answers1

2

The code for a worker role is usually a .NET assembly with a Run method. A process on the VM calls your Run method and expects it to run forever (never return). You can see the binaries on the VM in the \approot folder, usually on the e: drive.

By the way, web roles have the same thing. If you create a web role in Visual Studio, you'll see WebRole.cs, which implements the same interface as a worker role. The difference is that in a web role, you'll also have one or more web sites configured that are, as you mentioned, configured and run under IIS.

user94559
  • 54,841
  • 6
  • 85
  • 93
  • OK, I found this: waiishost.exe ... Any feedback on this one? – user1561202 Aug 16 '12 at 18:58
  • @user - on a webrole that's the process. On workers it is typically WaWorkerHost.exe (or something like that, my memory may be off). – Brian Reischl Aug 16 '12 at 19:01
  • @breischl You are definitely correct, but I'm running the worker role from within WebRole.cs to avoid the cost of a separate server. I wonder if there will be any implications in doing so... – user1561202 Aug 16 '12 at 19:08
  • I recall seeing articles about doing that, but I haven't done it myself so I couldn't give you any pointers. Actually @smarx might've blogged about that at some point - seems like something he'd do. :-) – Brian Reischl Aug 16 '12 at 19:15
  • I think @user1561202 might be referring to this blog post: http://www.31a2ba2a-b718-11dc-8314-0800200c9a66.com/2010/12/running-multiple-threads-on-windows.html – Sandrino Di Mattia Aug 16 '12 at 19:26
  • @SandrinoDiMattia Actually it is this one: http://www.31a2ba2a-b718-11dc-8314-0800200c9a66.com/2010/12/how-to-combine-worker-and-web-role-in.html – user1561202 Aug 16 '12 at 19:40
  • I did write a little about that too, in http://blog.smarx.com/posts/web-page-image-capture-in-windows-azure. :-) – user94559 Aug 16 '12 at 20:30
  • @user1561202 Terminology point: there's no such thing as "running the worker role from within WebRole.cs." Your role is either a web role or a worker role. – user94559 Aug 16 '12 at 20:31
  • @smarx Looks like an identity crises. – user1561202 Aug 17 '12 at 02:17