Issue with Creating Linked Server from Azure SQL Managed Instance to On-Premises SQL Server

GP 16 Reputation points
2025-01-10T13:05:06.25+00:00

Hi,

Interestingly, I was able to create a linked server in the reverse direction—from the on-premises SQL Server to my Azure SQL MI—using a remote login and password for authentication.

However, when I attempt to establish the link from Azure SQL MI to the on-premises SQL Server, it consistently fails.

 

Additional Details:

I have an Azure VM within the same VNET as the SQL MI. From this VM, I successfully tested connectivity to the on-premises SQL Server using both ping and telnet.

Despite verifying inbound and outbound rules for the SQL MI in Azure (ensuring the necessary ports and IPs are open), the connection fails with the following errors:

Error 1:

Data Source: tcp:DB1.xx,1433

Provider: MS OLEDB Driver for SQL Server

TCP Provider: No such host is known.

OLE DB provider "MSOLEDBSQL" for linked server "MYLINKED" returned message "Login timeout expired."

OLE DB provider "MSOLEDBSQL" for linked server "MYLINKED" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server."

Error 2:

Data Source: DB1.xx

Provider: MS OLEDB Driver for SQL Server

Named Pipes Provider: Could not open a connection to SQL Server [53].

OLE DB provider "MSOLEDBSQL" for linked server "MYLINKED" returned message "Login timeout expired."

OLE DB provider "MSOLEDBSQL" for linked server "MYLINKED" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible."

Error 3:

Data Source: Directly specifying the linked server name

Named Pipes Provider: Could not open a connection to SQL Server [53].

OLE DB provider "MSOLEDBSQL" for linked server "DB1.xx" returned message "Login timeout expired."

OLE DB provider "MSOLEDBSQL" for linked server "DB1.xx" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible."

 

 

 

Given these errors, I am wondering if this configuration is truly possible or supported.

Any insights, suggestions, or guidance would be greatly appreciated.

 

Thanks!

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,320 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vijayalaxmi Kattimani 905 Reputation points Microsoft Vendor
    2025-01-10T15:49:46.0666667+00:00

    Hi @GP,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    We would like to inform you that, it is possible to create a Linked Server from an Azure SQL Managed Instance to an on-premises server. To achieve this, you must ensure that the necessary network paths are open to the on-premises server and verify that outbound NSG rules and DNS resolution are correctly configured for the Managed Instance subnet. Additionally, ensure that any firewalls on the on-premises server are configured to allow traffic from the Managed Instance.

    The feasibility also depends on the configuration of your on-premises network. It is recommended to test DNS resolution and connectivity (e.g., using ping) from the SQL Agent to confirm that networking is functioning as expected. Once connectivity is verified, you can proceed with setting up the linked server.

    Please refer to the below mentioned links for more information.

    https://techcommunity.microsoft.com/blog/azuresqlblog/how-to-test-tcp-connectivity-from-a-sql-managed-instance/3058458

    https://learn.microsoft.com/en-us/sql/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine?view=sql-server-ver16&source=recommendations

    I hope this information helps. Please do let us know if you have any further queries.

    If the answer is helpful, please click "Accept Answer" and "Upvote it".

    0 comments No comments

  2. Javier Villegas 900 Reputation points MVP
    2025-01-11T23:59:48.3366667+00:00

    Hello

    have you tried by creating an Alias in SQL Server Configuration Manager for MYLINKED?

    https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/create-or-delete-a-server-alias-for-use-by-a-client?view=sql-server-ver16

    Regards

    Javier

    0 comments No comments

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.