how to can I get DIP and VIP addresses?

Answered how to can I get DIP and VIP addresses?

  • Wednesday, October 26, 2011 3:21 PM
     
     

    Im trying to show the VIP and DIP addresses but I don't know how to get them, I'll apreciate your help.

    Thanks in advance!!!

All Replies

  • Wednesday, October 26, 2011 8:39 PM
     
     Answered Has Code

    Hi Guillermo,

    VIP:

    using System.Net;
    
    ...
    {
       IPAddress[] addresses = Dns.GetHostAddresses("myapp.cloudapp.net");
    }
    


    DIP:

    using System.Net;
    using Microsoft.WindowsAzure.ServiceRuntime;
    
    ...
    {
        foreach (RoleInstanceEndpoint endpoint in RoleEnvironment.CurrentRoleInstance.InstanceEndpoints.Values)
        {
             IPAddress address = endpoint.IPEndpoint.Address;
        }
    }
    



    With regards,

    Patriek

    www.patriekvandorp.net
    If this reply is of help to you, please don't forget to mark it as an answer.
  • Wednesday, October 26, 2011 8:45 PM
     
     

    Thanks Patriek,

    this was very helpful,

    I appreciate that you aswer my question.

     

     

    Thanks

    Guillermo Sanchez

  • Wednesday, October 17, 2012 4:04 PM
     
     
    you saved me by showing how to get VIP. Great thanks. 
  • Thursday, January 03, 2013 9:46 PM
     
     
    I am trying to get the VIP at runtime in the VM. How can I know the dns name?

    LinhuiBaby