In the last months our customers reported several connectivity issues with the error message: provider: TCP Provider, error: 35 - An internal exception was caught that is part, for example, this previous error message, for example, 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."
There can be many reasons.. is it prefixed with during pre-login handshake. So, in this situation, it is important to implement our retry-logic also, you could find a very interested article from our product team https://learn.microsoft.com/en-us/sql/connect/ado-net/sqlclient-troubleshooting-guide?view=sql-server-ver16#hostname-resolution-errors with several solutions and approaches.
Additional information:
- Issue: TCP Provider, error: 35 - An internal exception was caught" when connecting to Managed Instances · Issue #20192 · microsoft/azuredatastudio (github.com)
- Github repository: https://github.com/dotnet/SqlClient
Enjoy!