user152949
user152949

Reputation:

List all the Azure instances

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

Answers (1)

Yossi Dahan
Yossi Dahan

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

Related Questions