how to connect azure sql with private link using azure data studion connection string

오혜원 41 Reputation points

hi i am figuring out how to connect azure sql with private link using azure data studio connection string.
azure sql is connected with private endpoint (ip).
i need help about connection string form using ip address.

Azure SQL Database
Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
490 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,381 Reputation points Microsoft Employee

    Hi @오혜원 ,

    Please try using connection string from the SQL Database in Azure Data Studio like shown below:


    Connection string format can be found as shown below:


    Try to connect and let us know if you face any issue.

    If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

  2. TP 83,721 Reputation points


    When using private endpoint with Azure SQL Database, you still use the server's public FQDN to connect, so in this way the connection string you use is the same as you would if the server was publicly available. You do not need to use the private ip address in the connection string to connect.

    The reason you can still use the public FQDN when connecting via private link is you typically link an Azure Private DNS Zone to the virtual network and the necessary DNS records for the private ip will be created automatically.

    For example, say you have an Azure SQL Database server named with private endpoint in your virtual network, with ip address of You connect using VPN, open command prompt, and run nslookup on


    You can see from above screenshot that DNS lookup for is returning the correct private ip address ( which allows you to use the same FQDN in your connection string to connect via private link.

    If you are unable to connect using the server's FQDN then you need to check the DNS configuration of your virtual network and make necessary changes.

    Azure Private Endpoint DNS configuration

    Alternatively if you are unable to use DNS you can edit your client PC's hosts file and add an entry for your Azure SQL Database server's private ip address. That way Azure Data Studio will be able to resolve the private ip address.

    On Windows PC, the hosts file is located in C:\Windows\System32\Drivers\Etc. You will need admin privileges to edit the file, so browse to C:\Windows, right-click on Notepad and choose Run as admnistrator, then open the file and edit it. Make sure you select All Files in the Open window because the hosts file doesn't have an extension and thus by default won't be shown when you navigate to the folder.

    Below is screenshot of hosts file for above sample database--replace information with your server's FQDN and private ip address.