1

I have this problem i can't figure out. I'm working on a dotnet core app through Azure web app on a linux server. This app uses an Hybrid connection to connect the Azure app to a on premise SQL Db.

With the 2.0 net framework everything worked fine. But now i have to update the framework because 2.0 is no longer supported. So i decided to update the framework from .net 2.0 to .net 6.0.For making that work i needed to change some routing but i also needed to add a nuget Microsoft.Data.SqlClient package because System.Data.SqlClient didn't work anymore.

So far so good, i made the adjustments and when i test it locally everything works fine.

But when i want to test it on the Azure Web environment it doesn't work anymore and i get this strange error i can't resolve. The strange thing is that i didn't change the Hybrid Connection which worked with .net 2.0, the only thing i changed whas the nuget package...

What's also strange is that the Hybrid Connection Manager says it's connected, there is no firewall, i added TrustServerCertificate=true at the connection string, i increased the timeout on the SQL database, the TCP/IP is enabled on SQL Services, the ports and name are correct, i close all my sqlconnections in dotnet... But still somehow the connection through the hybrid connection takes to long and results in a timeout error..

2022-09-23T10:56:56.644776242Z Microsoft.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=691; handshake=61012;

I tried everything... Does anyone know what i can try to resolve this issue?

mikus
  • 3,042
  • 1
  • 30
  • 40
Carsten
  • 11
  • 1
  • I would start by trying to ping server IP and see if there is a route to the server. This webpage give additional debug methods : https://spgeeks.devoworx.com/check-sql-server-instance-connectivity/ – jdweng Sep 23 '22 at 12:36

0 Answers0