Search code examples
c#sql-serverazure-sql-databasesqlclientazure-sql-server

EvtID:10060:Cannot connect to....A network-related or instance-specific error occurred while establishing a connection to SQL Server


I am try to connect Azure Cloud Sql Database from my local machine through SQL Server Management Studio (SSMS) 2017/18.In Server Firewall Rule added client IP,but Not getting connected and throwing error as below.

===================================

Cannot connect to integtenantelasticsql.database.windows.net.

===================================

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: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (.Net SqlClient Data Provider)

------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=10060&LinkId=20476

------------------------------ Error Number: 10060 Severity: 20 State: 0

------------------------------ Program Location:

at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server) at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

===================================

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Also performed the following Operations:

-Network reset

-IPV4 and IPV6 DNS server address update.

-SQL Server Configuration Manager IPV4 TCP enable disable

-SQL Server services stop, start.

-System windows 10 64bit up to date.

-Network driver uninstall installation.

-Telnet

Telnet cmd: telnet integtenantelasticsql.database.windows.net. 443 working.

-C# sql client:

I have tried sample console app using c# Sql client, but getting the same issue.

Not getting what is the issue? Help is very much appreciate.

Could you please suggest me the solution.

Thanks in advance.


Solution

  • There was a problem with TCP port 1433 not there in my system firewall Inbound setting.

    So have did the following steps

    -Enabling protocols for port 1433

    -Create a Firewall exception

    -And Apply to the Database Engine Instance Service

    for more details reference link here.

    After follow the same reference link problem got solved.