Can't connect to SQL Managed Instance from on prem

Ryan Pighin 91 Reputation points
2022-12-06T21:52:59.017+00:00

We are testing migrating some our on prem SQL servers to SQL Managed Instance in Azure. Our on prem currently connects to Azure via VPN Gateway. From there we always peer the vnets to the Vnet HUB in order to communicate inside Azure (hope that makes sense). I can connect to the SQL MI using SSMS on an Azure VM that sits inside the vNET Hub without issue. When I try from on prem using SSMS, I get the below error message. We have confirmed the firewall rule connecting on prem is fine (it matches another set up we have for an older SQL MI). I am just wondering if there is anything extra I need in the routing table or NSG to allow this connection.

267924-image.png

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2022-12-07T03:16:16.07+00:00

    One way to solve this is to add a second route to allow responses to flow properly. On the routing table that is added to the subnet where SQL Managed Instance is deployed, the default route may be 0.0.0.0/0 with next hop internet which is trying to send the response back over the internet. Try adding another route to the routing table for your on premise subnet with next hop Virtual Network Gateway.

    0 comments No comments

  2. Ryan Pighin 91 Reputation points
    2022-12-07T15:48:04.84+00:00

    thanks for the suggestion. did more work this morning and ended up being a misconfigured Peer Setup.

    268301-image.png


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.