Linked server between a SQL Managed Instance and an Azure VM-based SQL Server in different virtual networks?

Elliot Stansfield 1 Reputation point

We have a requirement to set up a linked server connection from our Azure SQL Managed Instance which sits in VNET A to a 'regular' SQL Server installation running on an Azure VM, which sits in VNET B (which is in a different region).

Despite various changes made to NSG's on both sides to allow the necessary connections, it does not work, with a generic connection error shown when attempting to setup the connection in SSMS (despite trying various combinations of settings and connection strings). Weirdly though, I can set up the linked server connection the other way without any issues (i.e. from the Azure VM-based SQL Server TO the Managed Instance), just not the other way around.

Is this even a feasible scenario? And if so, what are the specific steps to get this working?

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

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 13,261 Reputation points Microsoft Employee

    @Elliot Stansfield Thank you for reaching out.

    Yes, it is possible to set up a linked server connection from your Azure SQL Managed Instance to a SQL Server installation running on an Azure VM in a different VNET. Please check if both vnet are peered. The Windows firewall on the VM side should allow inbound traffic from SQL MI on port 1433.



    0 comments No comments