title: Connecting to SQL Azure from Azure VM - internal IP or public VIP
body: <p>I have an SQL Azure database and Azure Virtual Machine with an application connecting to the database. </p>
  
  <ul>
  <li><p>They are in the same datacenter and under the same Azure
  subscription. </p></li>
  <li><p>I added public virtual IP of the virtual machine to the list of
  allowed IP addresses in the server configure page of management
  portal. </p></li>
  <li><p>Windows Azure Services are marked "Yes" in the "Allowed Services"
  section.</p></li>
  </ul>
  
  <p>When trying to connect, I receive exception: "Client with IP address 'x.x.x.x' is not allowed to access the server.", where x.x.x.x is the internal IP of the VM. I am hesitant to use internal IP in an allowed IP rule. Shouldn't SQL Azure see public IP of the VM during connection? </p>