RoleInstanceEndpoint.RoleInstance Property
Gets the RoleInstance object that is associated with an endpoint.
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
Property Value
Type: Microsoft.WindowsAzure.ServiceRuntime.RoleInstanceType: Microsoft.WindowsAzure.ServiceRuntime.RoleInstance
An instance of RoleInstance.
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"); } } }
Show: