Requirement
I have an On-Premise SQL Server and an Azure webApp Service that needs to talk each other. I installed Hybrid Connection Manager on another computer which is in the same LAN as the SQL server. Let's refer this computer as the Connection PC.
The working part
Installation and configuration was straight forward, status of the hybrid connection showing as connected.
Tested the WebApp on localhost, it worked fine. Which means nothing wrong with the asp.net code
SSMS on the connection PC can access and query SQL DB
I installed a test SQL DB on the connection PC itself and use the WebApp to talk to the test DB instead, It worked fine.
The Problem
After tested ok on localhost, I published ASP.Net WebApp to Azure, it gave 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
troubleshoot attempt
Does that mean Hybrid Connection manager has to be installed on the same computer that runs SQL Server?
I did attempt to install HCM on the SQL Server, but it says it cannot work with Win2008R2. The connection PC has win2012 on it. So it can have HCM.
I just do not have time to migrate the SQL Server to another server. So I hope HCM does not have to be on SQL server.
Connection String
In my webapp, the connection string is as follows.
connectionString="metadata=res:///ScaleDataModel.csdl|res:///ScaleDataModel.ssdl|res://*/ScaleDataModel.msl;provider=System.Data.SqlClient;provider connection string="data source=WIN2008R2\DataPlus;initial catalog=DataPlus;persist security info=True;user id=test;password=testpass;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient"
Hybrid Connection communicates via TCP ports thus you need to specify the listening static port in your connection string like:
Data source=ServerName:Port;
Also here is an actually detailed article about the all problems you may encounter while working with Hybrid Connections.
Hope this helped you.
Since you have a hybrid connection, your connection string should have the endpoint name of your hybrid connection as the data source. Try replacing it.
Related
I am doing a VB.NET application, using SQL server as my database. SQL sever is located on other network connected via draytek VPN Matcher, Can you please recommend, what is the best connection string to connect to SQL Server from windows form application using oledb
Thanks to all
I tried using the IP directly with port 1433. I could connect through SSMS but not by the VB.Net application. I tried the SSMS it connects, but my appliction do not connect. It gives Error, server is not available any more.
I am unable to access database using c# application from all client computers in the same network but main computer sql server worked fine. Note: all settings like TCP/IP ping, firewall, .net installed is set already. Is there any good code to establish connection or connection string?
Code to establish connection or connection string accessible through other computer without sql server installation
We have configured the Azure Hybrid Connection in the App Service which we want to access the SQL Server Analysis Services from On-Prem server. The port configured in Hybrid Connection is 2383. The connection status is showing connected on both the Azure and in the Hybrid Connection Manager of the On-Prem server. But when we run the application it is throwing A connection cannot be made. Ensure that the server is running.
Most probably you might be having issue with TLS version that is currently enabled on your on-premises server. A detailed article on how to tackle each and every problem that you might be facing with the HCM can be found here.
Hope this might be sufficient to solve all your problems.
I am hosting a bunch of micro-services and bot apps using Docker, and Azure virtual machines. There´s also a dockerized SQL Server 2017 instance in the stack, which I would like to migrate to Azure SQL. I am out of luck when trying to configure the source database in an Azure Database Migration project...
I tried to specify the service endpoint including the exposed port (since the dockerized SQL Server container´s public port is not 1433). I can connect to the SQL Server instance using SSMS from my workstation with no error, so connectivity is not the problem at all; does the Azure Database Migration require port 1433, or if not, how can I correctly specify a different port?
These are the error details I got from source details configuration in the Azure portal:
Error Type
Failed to connect, please check error details
Error Detail
Collector 'Microsoft.SqlServer.Advisor.SqlQueries.Contracts.Models.IQueryServerProperties' failed to collect data. 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)
The parameter is incorrect
The source database configuration wizard is not very clear about the format of the remote server´s DNS name. Just specifying the fully qualified DNS name and port is not enough; it must contain the server´s instance name as well.
Wrong:
<DNS-name>,<port>
Correct:
<DNS-name>\<INSTANCENAME>,<port>
My azure application successfully running with azure sql database,but now i want to run Cloud application with my own database servers because of their data security. for this, we can establish the local database connection from our own systems with cloud application and connect to my database perfectly with following steps using below link,
http://www.codeproject.com/Articles/261063/Azure-Virtual-Network-Connecting-Local-Database
After this i deployed my application in to azure and it deployed without any error.but when i try to run my cloud application using cloud url like xxx.cloudapp.net getting an error like
"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 - The requested name is valid, but no data of the requested type was found.)".
Please give some suggestions why am getting this error.
Thanks,
PCSSCP.
Try connecting using SQL Management from another machine outside of your network. I believe that there is no problem with publication in Azure Cloud Service, but a connectivity problem with your SQL server.
Arthur Oliveira
You have to remote to VM and check SQL Server port is opened or not, the same with SQL Server machine. I used to connect local DB with cloud based application.
This is an intermittent issue with the SQL Server.
Check this link if it helps,
IntermittentSQLServerIssue