Blog Post

Azure Database Support Blog
1 MIN READ

Lesson Learned #63: It is possible to create Linked Server in Azure SQL Managed Instance?

Jose_Manuel_Jurado's avatar
Mar 14, 2019
First published on MSDN on Jan 19, 2019
The answer is Yes!!! and to create it you only need to follow up the instructions provided in this URL Unfortunately, nowadays, you only are able to use the SQL provider to connect to Azure SQL Database, SQL Server or Azure SQL Managed Instance.

My lessons learned in this situation is you need to pay attention

  • For Azure SQL Database:

    • Please review this URL to open the outbound ports 1433,11000-11999 and 14000-14999 to connect to Azure SQL Database

    • Remember to use in the user name@server in the user name format.

    • If you want to reduce the surface security impact and only open the port 1433 as outbound, please, review this URL to disable the re-direction process.

    • Finally, remember that the IP source of the Azure SQL Managed Instance will be the IP of the external load balancer and you need to open in your Azure SQL Database firewall - Review this URL. Also, there is not possible nowadays to add the service endpoint of our Azure SQL Database.



  • If you are connecting to SQL Server or to another Azure SQL Managed Instance you need the port 1433.


Enjoy!
Updated Mar 14, 2019
Version 2.0
  • Jose_Manuel_Jurado thanks for this. Helped us out. One thing to mention is that when connecting Azure SQL DB, you can't use 4-part queries, so you need to create the Linked Server via T-SQL and include the Initial Catalog. But thanks, since we used this post as proof that you could indeed connect to Azure SQL DB, and I also didn't know about 14000-14999 for DAC.

  • nenea_nelu's avatar
    nenea_nelu
    Copper Contributor

    "The answer is Yes!!! and to create it you only need to follow up the instructions provided in this URL "  - kindly would anyone be able to provide a bit more detail or point to specific documentation showing how to create a Linked Server FROM/ON the Azure Managed Instance to On-Premise SQL Server?

  • How to create a linked server from Azure SQL Managed Instance to SQL Server  Azure VM

     

  • Swampcritter's avatar
    Swampcritter
    Copper Contributor

    Linked Servers on Microsoft platforms utilize the Tabular Data Stream (TDS) protocol, which is commonly blocked by hosted/managed providers. We had this initial issue as well on the Amazon AWS SQL RDS platform that was affecting several of our in-house applications from migrating over to AWS. So after a few months of research and several proof of concepts later, I was successful on implementation of a solution using a 3rd party app (along with a unique configuration I designed). Then after finding posts like this, I found that my solution can be applied to Azure managed instances as well to connect to on-premise hosts. I would test it on Google Cloud as well, but found they don't support SQL Server... yet, but I am betting the solution will work there as well.

  • Walter_P1972's avatar
    Walter_P1972
    Copper Contributor

    Hi, I have been searching for some instructions regarding creation of linked server on managed instance on Azure to SQL server on premise. For some reason there are plenty of examples on creating linked server on-prem to Managed Instance. I tried different providers and get the error that server can not be found. I wonder if it has something to do with security.