Reputation:
How do I list all the instance computers in my Azure farm? I want to do some internal calls from one instance to all the other.
Upvotes: 2
Views: 1327
Reputation: 5377
This should help - http://msdn.microsoft.com/en-us/library/windowsazure/gg433051.aspx
foreach (RoleInstance roleInst in RoleEnvironment.CurrentRoleInstance.Role.Instances)
{
Trace.WriteLine("Instance ID: " + roleInst.Id);
foreach (RoleInstanceEndpoint roleInstEndpoint in roleInst.InstanceEndpoints.Values)
{
Trace.WriteLine("Instance endpoint IP address and port: " + roleInstEndpoint.IPEndpoint);
}
}
Upvotes: 7