SQL Server Error: 10060.

Julian McNeill 0 Reputation points
2025-02-18T18:58:39.0233333+00:00

Unable to connect to my managed instance. My public endpoint is enabled. Error I'm getting when I try to login via SSMS. I added an inbound security rule that is higher than the "deny_all_inbound" rule. My rule port is set to 3342, protocol TCP, source any, and destination any. The action is set to allow.

TITLE: Connect to Server


Cannot connect to free-sql-mi-5555637.81371bd0b3f3.database.windows.net.


ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)

For help, click: https://docs.microsoft.com/sql/relational-databases/errors-events/mssqlserver-10060-database-engine-error


A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond


BUTTONS:

OK


Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Naga Venkata Sai Vagdevi Poojitha Returi 0 Reputation points Microsoft Vendor
    2025-02-18T19:29:16.0666667+00:00

    Hello Julian McNeill
    Thank you for reaching out to Microsoft Q&A.

    It looks like you're trying to connect to your Azure SQL Managed Instance (MI) using SSMS, but the connection is failing despite enabling the **public endpoint
    Please try following steps to get this issue resolved.

    1. Verify That Public Endpoint is Enabled for Your Managed Instance**

    Run the following Azure CLI command to confirm:

    
    az sql mi show --name <your-managed-instance-name> --resource-group <your-resource-group>
    

    Check the publicDataEndpointEnabled property. If it's false, enable it using:

    
    az sql mi update --name <your-managed-instance-name> --resource-group <your-resource-group> --set publicDataEndpointEnabled=true
    
    
    

    2. Verify the Correct Port (Use 3342, Not 3343)

    Azure SQL Managed Instance only allows public connections on port 3342. Ensure SSMS is using port 3342:

    • In SSMS, go to OptionsConnection Properties.
    • Manually enter 3342 in the port field.

    3. Check NSG Rules and Firewalls

    Even though you've added a rule, let's double-check the Network Security Group (NSG) and firewall settings:

    • Go to Azure PortalNetworking (under your SQL MI).
    • Inbound Rules:
      • Priority: Ensure the rule allowing TCP 3342 is higher than Deny All Inbound.
        • Source: Try setting it to 0.0.0.0/0 for testing (then restrict it after testing).
          • Destination: Ensure it's set to Any (or your SQL MI subnet).
            • Action: Allow.

    Additionally, check the Azure Firewall:

    • If Azure Firewall is enabled, add a rule allowing TCP 3342 outbound.

    4. Verify Virtual Network (VNet) Peering and DNS Resolution

    • If your client is inside another VNet, ensure VNet peering is configured between your Managed Instance VNet and the client VNet.
    • If using a custom DNS server, make sure it resolves your MI's FQDN correctly.
      • Test DNS resolution:
            
            nslookup free-sql-mi-5555637.81371bd0b3f3.database.windows.net
        
        If it fails, temporarily switch to Azure-provided DNS.

    5. Test Connectivity Using Telnet or PowerShell

    Try connecting directly via Telnet:

    
    telnet free-sql-mi-5555637.81371bd0b3f3.database.windows.net 3342
    

    Or using PowerShell:

    
    Test-NetConnection free-sql-mi-5555637.81371bd0b3f3.database.windows.net -Port 3342
    
    • If it fails, something is blocking the connection (likely NSG, firewall, or public endpoint misconfiguration).

    6. Verify SQL Authentication Mode & Credentials

    • Ensure you're using SQL authentication (not just Azure AD).
    • Try logging in with admin credentials that were set during deployment.
    • If using Azure AD authentication, make sure your account has access:
        
        SELECT
        
        
      

    7. Try Connecting via Azure Data Studio

    • If SSMS fails, try Azure Data Studio using the same connection string.

    Final Steps

    • If everything looks correct but you still can't connect, try restarting the SQL Managed Instance:
        az sql mi stop --name <your-managed-instance-name> --resource-group <your-resource-group>
      

    az sql mi start --name <your-managed-instance-name> --resource-group <your-resource-group>

      
      If you find this helpful, please do not forget to accept this answer.
      
    

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.