Jump to content

Lesson Learned #238: Configuring Private Endpoint Connections in Azure SQL Managed Instance


Recommended Posts

Guest Jose_Manuel_Jurado
Posted

Today, I worked on a service request that our customer had some doubts about how to Configure Private Endpoint Connections in Azure SQL Managed instance (In Preview). Our customer reported us that the IP resolution of Azure SQL Managed Instance always points to the normal one instead of resolving the private endpoint IP. Following, I would like to share my lessons learned how to fix it.

 

 

 

We are going to configure two main components:

 

 

 

  • Private Endpoint Connection in Azure SQL Managed Instance.
  • Private DNS Zone.

Step #1: Configuring Private Endpoint Connection

 

 

 

 

  • The process is prety much the same process that we are using for Azure SQL Database but, in this case, for Azure SQL Managed Instance the Integrated Private DNS Zone needs to be configured in another way, for this reason is disabled nowdays. Let's create the Private Endpoint using the portal.

 

  • First, we are going to specify the basic details of the Private Endpoint.

 

 

 

542x327vv2.png.3224d66a952d79e1536a76de5a6f9b67.png

 

 

  • In terms of Resource, we need to configure only the name of the Azure SQL Managed Instance.

 

513x300vv2.png.f9c6c12c66b85c9c971c93f8cb120d28.png

 

  • For Virtual Network, we need to choose the Virtual Network and Subnet of the client (Virtual Machines, for example) that are going to connect to the Private Endpoint.

 

 

569x610vv2.png.f426be8323a50caedae85c483dd446fb.png

 

  • Finally, as you could see the DNS configuration is disabled for Managed Instance and we are going to configure later.

 

498x168vv2.png.46daece967466e556a6bc3fd25376260.png

 

 

Step #2: Private DNS Zone

 

  • Here is the main different, Private DNS Zone in Azure SQL Database will be privatelink.database.windows.net but Azure SQL Managed Instance we need to use privatelink.{dnszone}.database.windows.net. If we try to associate privatelink.database.windows.net to Azure SQL Managed Instance you are not going to have any issue in the definition but in terms of resolution won't work. Please, see the following URL
  • For example, my manage instance name is: mymanagedinstance.a34e740a3aca.database.windows.net
    • mymanagedinstance is the name of the instance.
    • a34e740a3aca is the DNS Zone
    • database.windows.net is the rest of FQDN (domain).

    [*]For this reason, we are going to create a new Private DNS Zone, with the name of, privatelink.{dnszone}.database.windows.net

 

505x413vv2.png.7a7f4a6e7473d24a3e9c747dd3fba5cf.png

 

  • After it, add the Private DNS Zone in Private Endpoint connection, specifying the Private DNS Zone, privatelink.{dnszone}.database.windows.net

 

 

 

500x250vv2.png.fede4941d09876e80572f1183498e690.png

 

  • Finally, modify the Private DNS Zone and add a virtual network link with the VNET/Subnet where client (Virtual Machines for example, will use this private endpoint to connect to your Azure SQL Managed Instance.

 

 

 

482x200vv2.png.0fe670f636b26b1714de1c7811cb8d21.png

 

 

 

Step #3: Testing the resolution.

 

 

 

 

  • Once we have configured, basically, we need to connect to our Virtual Machine, run the following command to review if the resolution is working well:
    • ipconfig /flushdns to renew the DNS.
    • ping or nslookup with the name of your manage instance and you could obtain the name of the private endpoint instead of the normal one.

 

491x258vv2.png.c720f6062841a5d76446f80c4d3438b8.png

 

 

Enjoy!

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...