RoleInstance::Role Property

 

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:
property Role^ Role {
	virtual Role^ get() abstract;
	internal: virtual void set(Role^ value) abstract;
}

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");
   }
}
Return to top
Show: