SQL Connectivity Issue From Cloud app to on-prem server

Santhi Dhanuskodi 325 Reputation points
2024-05-07T10:38:07.05+00:00

hi,

I have deployed a .net core MVC app in azure app service as a webapp.

I have to connect to a on-prem sql server to retrieve data. I have setup Azure relay/hybrid connection for the same. Also I have installed hybrid connection manager in on-prem server.

I get SQL connectivity issues intermittently. Either of these 3 errors. All these exceptions are occuring inconsistently. I have enabled TCP/IP already in the server.

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

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=121; handshake=59896;

Login failed for user '<userid>'.

We cannt see any logs from SQL server which are useful for this.

I suspect its more of Relay/hybrid connection issue. how do i troubleshoot this? What could be the causes? Where can we see additional logs for hybrid connection?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,663 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,128 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,000 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 67,916 Reputation points
    2024-05-08T16:12:29.83+00:00

    because you are using a proxy, the logs are not going to tell you much. aside from the timeout, there are no errors as far as the proxy is concerned.

    you will probably need to run a network trace between the on-prem client and the Sqlserver. an outgoing trace from the on-prem client to the azure proxy will tell you if you are getting connection / traffic issues.

    0 comments No comments

  2. MikeyQiaoMSFT-0444 3,190 Reputation points
    2024-05-14T09:25:52.63+00:00

    Hi,Santhi Dhanuskodi

    We haven't received a response from you for some time, and I would like to know the status of your issue. The issue may be caused by TLS. Please refer to the following documentation.

    https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/tls-exist-connection-closed

    0 comments No comments

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.