Hi Amal Edirisinghe ,
Welcome to the Microsoft Q&A Platform!
The error you’re facing a timeout during the SQL Server pre-login handshake, which typically happens when the SQL Server is unable to respond within the expected time frame. This issue can arise due to high latency, network congestion, insufficient resources, or improper configuration.
- Use tools like SSMS, Windows Performance Monitor, and SQL Profiler.
- Optimize queries, add indexes, or increase server resources (CPU/RAM).
- Update connection string.
Connection Timeout=60;
- Check diagnostic logs in Azure Portal for latency or dropped connections.
- Configure a secondary hybrid connection for failover.
- If possible, migrate the database to Azure SQL to reduce dependency on on-premise infrastructure.
- Upgrade to a higher-tier plan like P2V3 or increase instance count.
- Review firewall rules and use Azure Network Watcher to troubleshoot connectivity issues.
- Add
Max Pool Size=100;
to the connection string. - Add retry mechanisms for transient errors.
ref:https://learn.microsoft.com/en-us/azure/app-service/app-service-hybrid-connections Let me know if further assistance is required.for (int retry = 0; retry < maxRetries; retry++) { try { /* Attempt operation */ break; } catch (SqlException ex) { Thread.Sleep(TimeSpan.FromSeconds(2)); } }
If the answer is helpful, please click Accept Answer and kindly upvote it