Cannot connect to Azure SQL DB using private endpoint from a peered network

Subash Basnayake 61 Reputation points
2022-03-24T12:13:17.627+00:00

I have 2 v-nets in 2 subscriptions v-netA and v-netB.
v-netA and v-netB has a v-net peering configured.
v-netA has a VM-A and v-netB has VM-B. These VMs can communicate with each other which means that the v-net peering works fine.
v-netA has Azure SQL DB (paas) in which the public access is disabled and a private endpoint is configured.

I can connect to the SQL DB using SSMS installed in VM-A and when I use nslookup for the <sqlsrv>.database.windows.net it gives me the private IP of the endpoint.

When I try to connect to the SQL DB using SSMS installed in VM-B it gives an error and the nslookup gives a random IP that I can't recognize.

Where am I doing wrong?

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.
469 questions
{count} votes

Accepted answer
  1. Vidya Narasimhan 2,201 Reputation points Microsoft Employee
    2022-03-24T13:19:39.3+00:00

    Hi @Subash Basnayake it seems like Vnet B is not linked to the private dns zone created for azure SQL private endpoint. Seems it is resolving to a public ip. Can you try linking the Vnet to the private dns zone for resolution? https://learn.microsoft.com/en-us/azure/dns/private-dns-virtual-network-links

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful