How to find public IP address of Azure SQL Server Database?

hawthorne91 240 Reputation points
2024-03-14T20:27:23.63+00:00

I was curious as to how I would be able to find the public IP address of my Azure SQL Server database? I am trying to connect an ETL tool to the program, however when I provide the server name, the DNS server is not able to resolve the domain name of the database instance. So I want to try to provide the public IP address of the Azure SQL Server database to the connector. Where is the public IP address of the Azure SQL Server database?

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. TP 124.7K Reputation points Volunteer Moderator
    2024-03-14T21:18:49.5+00:00

    Hi,

    In the portal, navigate to your SQL Database. On the Overview blade, make a note of the Server name. On your local PC, open a windows command prompt, and run command similar to below:

    nslookup yourservername.database.windows.net
    

    It should output the public IP address.

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP

    3 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2024-03-14T21:25:16.4933333+00:00

    It is very common see Azure SQL customers open support incidents because they couldn’t connect to their Azure SQL Database server which was ultimately due to the incorrect assumption that the server’s IP address is static. However, the reality is the IP address of your Azure SQL logical server is not static and is subject to change at any time. All connections should be made using the fully qualified DNS name (FQDN) rather than the IP address.

    Microsoft may do an online migration of your logical server between clusters within a region, load balancing capacity across the clusters within the region. This move is a live operation and there is no loss of availability to your database during the operation. When the migration completes, existing connections to your logical server are terminated and upon reconnecting via fully qualified domain name your ETL tool will be directed to the new cluster. However, if your ETL Tool caches or connects by IP address instead of FQDN then your connection attempts will fail.

    While you allow authorization for DNS resolution on the network, you can identify the IP address of the Azure SQL server by pinging the logical Azure SQL server from a network with DNS resolution allowed. The ping will not get a successful reply from the server but it will give the current IP address of the logical server.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.