Azure SQL connectivity

Python Developer 7 85 Reputation points
2024-09-10T12:15:50.8333333+00:00

Hello,

we have Azure SQL service DB and are having some problems with connectivity which can't really pinpoint.

From some places, it refuses connection. Like from my home, i try to connect using SQLAlchemy library in python but fails with timeout error

('HYT00', '[HYT00] [Microsoft][ODBC Driver 18 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')

Sometimes it works, sometimes it doesn't so the settings are correct. firewall settings permit my IP so it's not that.

I try telnet, it also fails

telnet mydb.database.windows.net 1433 Connecting To mydb.database.windows.net...Could not open connection to the host, on port 1433: Connect failed

we have app service deployed on azure and it works there, but not from my home or at least sometimes ....

we only have the lowest pricing plan for 13 EUR / month so we might be out of resources but how would i confirm this? DTU graph under monitoring doesn't even reach 10 % ...

how can i debug and pinpoint this problem?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Vinodh247 34,661 Reputation points MVP Volunteer Moderator
    2024-09-10T13:15:19.05+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    • Deploy a small VM in the same region as your Azure SQL Database and try to connect to the SQL server from that VM using the same tools and credentials. This can help determine if the issue is with your home network or your Azure setup.
    • Check your home network's stability and speed. Intermittent connectivity could be due to network instability or slow speeds.
    • If you are using a VPN or a proxy server from your home, try disabling it to see if it affects the connection stability to Azure SQL. Re-check the firewall settings on Azure SQL Database to ensure your home IP is indeed allowed. Sometimes, dynamic IPs can change, so verify the current IP is listed. Check if there are any Network Security Group rules applied at the subnet or the resource level that might be blocking your connectivity.
    • Verify if any server parameters or settings that might influence connectivity are configured differently from defaults, which might impact connections under certain conditions.
    • Use tools like tracert (on Windows) or traceroute (on Linux/Mac) to trace the route your packets take from your home to Azure SQL Database. This can show if there's a consistent point where packets drop. Also since telnet also fails, ensure that port 1433 is open and accessible from your network. Sometimes, ISPs may block certain ports used commonly by databases.
    • Enable client-side logging in SQLAlchemy to get more detailed error messages that might point to the exact cause of the failures.
    • Even though the DTU percentage is low, check other metrics like blocked by firewall attempts, failed connections, and other related metrics in the Azure portal.
    • Check if Azure SQL auditing is enabled and review the logs for any failed login attempts or errors that could give more context on the connectivity issues.

    Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.


0 additional answers

Sort by: Most helpful

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.