Problem accessing SQL Managed Instance from on-prem network

PJL 1 Reputation point
2021-04-06T21:26:48.187+00:00

I am trying to connect to an Azure SQL Server Managed Instance from my on-prem network which is connected to Azure via a Gateway VPN.

The gateway VPN terminates in VNET A and the SQL Server Managed Instance is in its own standalone VNET B.

Do I need to peer VNET A and B to be able to connect to the instance from my on-prem network and is there anything else I need to do?

SQL Server on Azure Virtual Machines
Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 13,946 Reputation points MVP
    2021-04-06T23:37:30.017+00:00

    Hi @PJL

    If you have SQL managed instance on the VNET B and VPN Gateway installed in VNET A, you should peer VNET A and VNET B.

    Connecting an application when it resides within a different virtual network from SQL Managed Instance is a bit more complex because SQL Managed Instance has private IP addresses in its own virtual network.

    Whatever choice you make, you can connect it to Azure SQL Managed Instance.

    85045-image.png

    Another scenario implemented by customers is where a VPN gateway is installed in a separate virtual network and subscription from the one hosting SQL Managed Instance. The two virtual networks are then peered. The following sample architecture diagram shows how this can be implemented.

    Virtual network peering

    VPN gateway can see the IP addresses in the virtual network that hosts SQL Managed Instance. To do so, make the following very specific changes under the Peering settings.

    1. In the virtual network that hosts the VPN gateway, go to Peerings, go to the peered virtual network connection for SQL Managed Instance, and then click Allow Gateway Transit.
    2. In the virtual network that hosts SQL Managed Instance, go to Peerings, go to the peered virtual network connection for the VPN gateway, and then click Use remote gateways.

    Refer-
    https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/connect-application-instance

    If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.

    0 comments No comments