Azure Hybrid Connection SSPI handshake failed - azure-hybrid-connections

I have an instance of Azure Hybrid Connections running on a server where SQL Server is installed.
I hosted an WebApp on azure, set up the hybrid connection and I'm consistently getting the same SSPI Handshake error
SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The operating system error code indicates the cause of failure. The logon attempt failed [CLIENT: 1x.xx.xx.xxx]
As described here I added the clients ip in the local security policy.
I also tried adding the DisableLoopbackCheck=1 in HKLM\System\CurrentControlSet\Control\LSA, but it didn't help either.
Do I have to fix it on a database level perhaps?

As per https://github.com/Huachao/azure-content/blob/master/articles/app-service-web/web-sites-hybrid-connection-connect-on-premises-sql-server.md
[AZURE.NOTE] To ensure that your application uses the database that you created in SQL Server Express, and not the one in Visual Studio's default LocalDB, it is important that you complete this step before running your project.
Edit the connectionStrings section to point to the SQL Server database on your local machine, following the syntax in the following example:
I added user credentials to my connection string in appsettings.json and it now works.

Related

Test connection failed because of an error in initializing provider . Prelogin failure Error

Trying to connect to an external datahub from a SSMS on a server. From desktop computer works.
Port 1433 allowed on server. Has anyone seen this or have a solution? Thank you.
Error:
Test connection failed because of an error in initializing provider. Client unable to establish connection due to prelogin failure
TCP Provider: The specified network name is no longer available.
Client unable to establish connection
Client unable to establish connection because an error was encountered during handshakes before login. Common causes include client attempting to connect to an unsupported version of SQL Server, server too busy to accept new connections or a resource limitation (memory or maximum allowed connections) on the server.

Unable to connect Azure Database from Kubernetes cluster using Kubeadm

I have a MVC application which is using Azure SQL database for data storage. I have created a docker image for the same.
Later, I have setup Kubernetes cluster on Ubuntu 18.4 using Kubeadm. The Linux VM is is created on azure cloud.
Initially, i have deployed my app on the single node cluster and the application was working as expected without any SQL connection issue. Then I have created two VM on the cloud and used it as Node 1 (master) and Node 2. Now i am facing an SQL connection issue after deploying my app on Node 2 machine.
Unhandled Exception: System.Data.SqlClient.SqlException: 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.Internals.SocketExceptionFactory+ExtendedSocketException: Resource temporarily unavailable
I tried and verified below options-
Added IPs to Azure SQL database firewall settings
From Linux Machine, tried to connect SQL database using sqlcmd
POD network is install correctly (calico)
Tried adding outbound rule for SQL port 1433 on VM
I have created a SQL database on VM and tried to connect this database from MVC app and it is also working.
Can someone please help me to diagnose and fix this issue? Please let me know if you want more details on this.

Visual Studio 2017 Web App with SQL Authentication Error 52

I am trying to publish a VS2017 web app to a godaddy domain with authentication on a remote SQL server. The app works fine when run from the Visual Studio environment. I can log in, register, etc and see the data on my SQL Server. When deployed I get ::
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: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]
Fixed - I discovered that the web.config file on the domain server did not get updated with the proper connection string.

SQL Server 2012 Express connection error

I installed SQL Server 2012 but not able to connection to express instance getting below error:
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)
SQL Server is attempting to register a Service Principal Name (SPN) for the SQL Server service. Kerberos authentication will not be possible until a SPN is registered for the SQL Server service. This is an informational message. No user action is required.
2012-07-20 11:37:08.72 Server The SQL Server Network Interface library could not register the Service Principal Name (SPN) [ MSSQLSvc/VIPUL-MEHTA.XXXX.com ] for the SQL Server service. Windows return code: 0x2098, state: 15. Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies and if the SPN has not been manually registered.
Here is my SQL Server Configuration settings
In management studio I am providing below information to connect:
Server: .\MSSQLSERVER
Authentication: Windows Authentication
In SQL Server 2012 how can I change the settings of Surface Area Configuration.
I forgot the password for SA, so I cannot connect using SQL Server authentication.
Here is TCP IP Settings:
Just open incoming port 1433 in the Windows firewall for TCP access:
http://blogs.technet.com/b/danstolts/archive/2011/06/08/how-to-open-firewall-port-1433-for-sql-server-database-engine-for-use-with-scom-or-anything-else.aspx
I just had this problem solved by following this guy's answer
Can't connect to localhost on SQL Server Express 2012 / 2016
re-installing SQL was the only solution in my case. Learning is always attach 2-3 windows account with SQL Server.
In my case, SqlServer Service was somehow stopped,i think it's because after installing MySql.I changed back it's state to 'Running', and it works now:
Go To Sql Server Configuration Manager
Click on 'Sql Server Services' in the left pane
Right click on the 'SQL Server' in the right pane and click on 'Start'
http://i.stack.imgur.com/ZuTV3.png

Cannot add App_Data SQL Server database

Using Visual Studio 2010 10.0.20319.1 RTMRel and SQL Server Express 10.50.1600.1 I'm trying to add a new SQL Server Database .mdf, however, I receive the following error:
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: SQL Network
Interfaces, error: 25 – Connection
string is not valid)
I have enabled TCP/IP and Named Pipelines, added Firewall Exceptions for Sql Server, I am successfully connecting from VS in the Server Explorer window.
I would appreciate if someone can pint me to a solution to my problem.
Thank you.
I think that SQL Server must be running locally to be able to create those databases.
I was getting the same error
Started my local .\SQLEXPRESS instance
no more error, and a cute .mdf file was created
According to your error
(provider: SQL Network Interfaces,
error: 25 – Connection string is not
valid)
check here what your connection string should look like
http://www.connectionstrings.com/sql-server-2008

Resources