RoleInstance.Role Property
Gets the Role object that is associated with the role instance.
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
Property Value
Type: Microsoft.WindowsAzure.ServiceRuntime.RoleType: 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"); } }
Show: