none
how to can I get DIP and VIP addresses? RRS feed

  • Question

  • 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!!!

    Wednesday, October 26, 2011 3:21 PM

Answers

  • 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:39 PM

All replies

  • 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:39 PM
  • Thanks Patriek,

    this was very helpful,

    I appreciate that you aswer my question.

     

     

    Thanks

    Guillermo Sanchez

    Wednesday, October 26, 2011 8:45 PM
  • you saved me by showing how to get VIP. Great thanks. 
    Wednesday, October 17, 2012 4:04 PM
  • I am trying to get the VIP at runtime in the VM. How can I know the dns name?

    LinhuiBaby

    Thursday, January 3, 2013 9:46 PM