RoleInstanceEndpoint.RoleInstance Property

 

Gets the RoleInstance object that is associated with an endpoint.

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

Public MustOverride Property RoleInstance As RoleInstance
	Get
	Friend Set
End Property

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


foreach (var role in RoleEnvironment.Roles)
{
   foreach (var roleInst in role.Value.Instances)
   {
      foreach (RoleInstanceEndpoint instanceEndpoint in roleInst.InstanceEndpoints.Values)
      {
         Trace.WriteLine("Role instance ID: " + instanceEndpoint.RoleInstance.Id, "Information");
      }
   }
}
Return to top
Show: