Today, we got a new service request where our customer faced the following error message connecting to Azure SQL Database using Azure Data Studio : "Microsoft.Data.SqlClient.SqlException (0x80131904): 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. (provider: TCP Provider, error: 35 - An internal exception was caught) System.Net.Sockets.SocketException (00000005, 0xFFFDFFFF): nodename nor servname provided, or not known"
Understanding the Error:
The error message suggests that the client (in this case, a MAC machine running Azure Data Studio) was unable to establish a connection with the specified SQL Server instance. Two exceptions are noted: "Microsoft.Data.SqlClient.SqlException" and "System.Net.Sockets.SocketException." The former indicates an issue with the SQL Server connection, while the latter points to a problem within the network socket.
Root Causes:
DNS Configuration: The error often occurs when the DNS (Domain Name System) configuration is incorrect or missing on the client machine. Without proper DNS configuration, the hostname of the SQL Server cannot be resolved to an IP address.
Solution:
To address the "Microsoft.Data.SqlClient.SqlException" and "System.Net.Sockets.SocketException" errors, follow these steps to rectify the DNS configuration on the client machine:
Enjoy!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.