SQL Private Endpoint can't be reached from VM in peered VNet

Alto, Abraham 60 Reputation points
2024-09-04T23:27:17.8733333+00:00

Hello,

I've configured a private endpoint to a SQL server and can access the SQL server using SSMS in a VM that's in the same vnet (SSMS in VM1). I also configured a peering connection between the vnet where the SQL private end point and the VM are in to another vnet.

User's image

I'm trying to access the SQL server using the SSMS from the VM2 that's in the peered vnet but I get an error that the SQL User's image

How do I configure the peered vnet (VM1 SSMS) to connect to the private endpoint?

Thank you in advance!

Azure SQL Database
{count} votes

Accepted answer
  1. TP 97,756 Reputation points
    2024-09-05T00:37:11.0833333+00:00

    Hi Abraham,

    You need to create a virtual network link from the private dns zone to the peered virtual network so that when the VM does DNS lookup for your Azure SQL Server it will receive the IP address of the private endpoint instead of the public address.

    To create virtual network link, browse to the Private DNS Zone that was created for your private endpoint -- Virtual links blade. Click Add, enter a name for the link, select the peered virtual network, click Create.

    qna sql server private dns vnet link

    qna sql server private dns vnet link create

    It may take a minute or so for it to finish creating the link, so wait for the success notification. Once it has been created, using command prompt, do nslookup of the FQDN (yourservername.database.windows.net) from the VM and make sure it is returning the private IP address instead of public.

    nslookup yourservername.database.windows.net
    

    Resolution virtual network

    https://video2.skills-academy.com/en-us/azure/dns/private-dns-virtual-network-links#resolution-virtual-network

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

    Thanks.

    -TP


0 additional answers

Sort by: Most helpful

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.