ADF Copy Actitity issue - sql-server

I have an issue where I can preview data from a source, a SQL Server connected through a Self-Hosted IR, but I cannot copy the data to a sink (Azure SQL DB on an EP).
The user account at the SQL Server level has access to the relevant tables, as can be verified by the fact that I can preview data. The sink side dataset also works, as I can use with similar data sources to the source.
If I, for example, try to fetch two specific rows, I can see them in the preview, but it takes 5 minutes for ADF to give an error message which is wildly misleading:
ErrorCode=SqlFailedToConnect,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Cannot connect to SQL Database: 'ServerName.database.windows.net', Database: 'DatabaseName', User: 'AdminUserName'. Check the linked service configuration is correct, and make sure the SQL Database firewall allows the integration runtime to access.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.SqlClient.SqlException,Message=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.),Source=.Net SqlClient Data Provider,SqlErrorNumber=10060,Class=20,ErrorCode=-2146232060,State=0,Errors=[{Class=20,Number=10060,State=0,Message=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.),},],''Type=System.ComponentModel.Win32Exception,Message=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,Source=,'
What am I doing wrong? Is there some setting I am missing?

Please check whether the Azure SQL DB(sink) is accessible from the server on which you have installed the self hosted IR.
YOu would need to whitelist the IP of the Self IR server in Azure SQL DB firewall rules and make some port opening in the IR server for Auzre SQL DB to be accessible.
Basically in case if an IR is being used in a copy activity, both the source and sink must be accessible from the server on which IR is set up

Related

Accessing SQL Server from Azure DevOps Pipeline

Problem
I have setup an Azure Pipeline, and the problem I have is that during the Test Assemblies part of the Pipeline it is failing as it can't resolve the connection string/find my SQL Server.
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) ---> System.ComponentModel.Win32Exception: The network path was not found
In this scenario, I want to avoid creating a mock and ideally have the code directly communicate with SQL Server.
The SQL Server is sat on an Azure VM, so it's not a 'Azure SQL Database' service.
What I've Tried
I have opened the ports on the Azure VM to allow traffic from all regions/IP ranges used by Azure DevOps (I have found online that this is required). I have also tried pointing the connection string inside the Pipeline 'Test Assemblies' to a different (on-premise) windows server which holds an instance of SQL Server, but it is still not able to find/connect to SQL.
When connecting to SQL from my local (both the Azure VM and on-premise server) I can connect. We also have a few other services using the SQL Server sat on the Azure VM, so I am confident that the connectivity issue is with connecting from an Azure Pipeline.
Has anyone had this issue before?
Update
I have updated the connection string to directly refer to the port i.e.
**.***.**.***,1433
And the error message has now changed to:
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 wait operation timed out.) ---> System.ComponentModel.Win32Exception: The wait operation timed out
I now have it working.
After having the Azure DevOps region changed from West Europe to UK South, my DevOps can now communicate with SQL Server on my VM (with the required IP addresses white listed as per Leo Liu-MSFT's comment).

Can't Connect to Azure Server from SQL Server

I can't connect SQL Server to Azure. When I try to connect I get this error:
How can I solve this?
Connect to Server
Cannot connect to mukdo.database.windows.net.
ADDITIONAL INFORMATION:
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.) (Microsoft SQL Server, Error: 10060)
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
Make sure your IP is added in the firewall setting in Azure SQL. You can use 'Add client IP', if it's not added.enter image description here
My problem Solved After Change My Internet Connection

HTTP Error 500.30 - ANCM In-Process Start Failure - An error occured during migration

I have read this thread, however unfortunately couldn't find the solution to my problem. I have an ASP.Net Core project (that's called Rent) and it works without any problem on my local machine. However, once I publish the project to the IIS (still in development mode) I get the below error
fail: Rent.Program[0]An error occured during migration
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: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.
---> System.ComponentModel.Win32Exception (0x89C50118): Unknown error (0x89c50118)
The connection string is called DefaultConnection and is the environment variable. Can anyone help me please? Can provide any additional information if required.
The first thing you should check is that your SQL Server instance is up and running and that your database is still available. This error means quite literally that it can't establish a connection to SQL Server from the Secret Server application.
And you can also check follow things in your environment:
Is something blocking the connection between your Secret Server server and SQL Server?
The standard SQL port is 1433. Check with your server administrator - is the Windows Firewall in use, blocking this port on your SQL server? Check with your network administrator - is there a firewall at some point in between that has closed off this port? Keep in mind that if you use a custom port for SQL, it need to be specified the Secret Server database connection using a SQLSERVER,port type of format.
On the server hosting your SQL Server database, is the SQL Server
service running?
Open services.msc or SQL Configuration Manager to view the status of your SQL Server service.

Unable to connect SQL Server to an Excel sheet

I am trying to connect SQL Server to an Excel sheet using get data source. I have two systems: System A has SQL Server installed, and I'm trying to connect to System B using an Excel sheet.
When I provide the details as
Server: 10.100.84.224\DOHVP1C00JIRA01 and Database: jiradb1
Click on "Ok", I get an error
Unable to Connect
Details: "Microsoft SQL: 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)
I have checked all the connection which are configured and looks fine like port numbers and I followed this link too
SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
Note: if we want to access System B is VPN secure and we have opened for those too.
Please check if the TCP/IP is enabled in SQL Server Configuration Manager for the server end.
Besides, please make sure that the SQL Server is allowed remote connection.
And you use the instance name to connect the server, please ensure that the SQL Server Browser service is started.
By the way, you can ping the IP address to check if the network is we

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

In my remote server I log in SQL Server with SQL Server Management Studio. It works.
But on my PC when I try to log in I get an error. I add port to server name but I still get the same error. My TCP/IP is enabled. Port is enabled
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)

Resources