SALES: 1-800-867-1380

RoleInstance.Role Property

Updated: December 6, 2013

Gets the Role object that is associated with the role instance.

Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)

public abstract Role Role { get; }

Property Value

Type: Microsoft.WindowsAzure.ServiceRuntime.Role

An instance of Role.

The following code example shows how to retrieve the name of the role that is associated with the role instance:


foreach (var role in RoleEnvironment.Roles) 
{
   foreach (var roleInstance in role.Value.Instances)      
   {
      Trace.WriteLine("Role for the instance: " + roleInstance.Role.Name, "Information");
   }
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows 7 and Windows Server 2008

Target Platforms

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft