Search code examples
c#azureazure-worker-roles

Identifying which Azure WorkRole Instance is executing the Queue?


I am working on Azure Worker Roles. I have a worker role which is scaled up to 5 instance. I want to identify which Instance processed the queue item. I know, I can use RoleEnvironment.Roles to get the list of the instances but not sure how to get the actual instance.

Thanks in advance.


Solution

  • You are looking for

    RoleEnvironment.CurrentRoleInstance.Role.Name