RoleInstanceEndpoint.IPEndpoint Property
Gets an IPEndPoint object for the role instance endpoint. The IPEndPoint object provides the IP address and port number for the endpoint.
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
The following code example shows how to retrieve the IPEndPoint objects for the running role instances:
foreach (var role in RoleEnvironment.Roles) { foreach (var roleInst in role.Value.Instances) { foreach (RoleInstanceEndpoint instanceEndpoint in roleInst.InstanceEndpoints.Values) { Trace.WriteLine("Instance endpoint IP address and port:" + instanceEndpoint.IPEndpoint, "Information"); } } }
Show: