RoleInstanceEndpoint.PublicIPEndpoint Property
Gets an IPEndPoint object for the role instance endpoint. The IPEndPoint object provides the port number for the direct port endpoint. The IP address in the property is unused.
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
The following code example shows how to retrieve the direct port 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 port:" + instanceEndpoint.PublicIPEndpoint.Port, "Information"); } } }
Important |
|---|
The value of this property is null when running in the emulator. |
Show:
