Unable to connect on-prem SQL database to AzureSQL database in Azure Data Factory

Steve Herz 36 Reputation points
2022-08-03T16:25:39.79+00:00

I have a copy data task in my AzureDataFactory pipeline (source = on premise SQL; sink = AzureSQL) that keeps generating the following error:

ErrorCode=SqlFailedToConnect,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Cannot connect to SQL Database: 'xxx', Database: 'xxx', User: 'xxx'. 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 connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.),Source=.Net SqlClient Data Provider,SqlErrorNumber=64,Class=20,ErrorCode=-2146232060,State=0,Errors=[{Class=20,Number=64,State=0,Message=A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.),},],''Type=System.ComponentModel.Win32Exception,Message=The specified network name is no longer available,Source=,'
Source
Pipeline
pipeline1

The IP address of the Self-hosted Integration Runtime is whitelisted in my AzureSQLServer and I've allowed Azure services and resources access to the server.

My self hosted integration runtime indicates it is running successfully. My linked service referencing the SHIR connects successfully. The datasets referencing the linked service all connect successfully.

When I originally created the project I was using a different SHIR to my local machine but we are trying to deploy this now and connect to a different SHIR. All works successfully when connected to my local machine but the above message is encountered when connecting to the other SHIR.

Azure SQL Database
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
0 comments No comments
{count} vote

Accepted answer
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2022-08-03T17:36:54.907+00:00

    Please make sure you have opened all the ports listed here.


1 additional answer

Sort by: Most helpful
  1. Nandan Hegde 36,146 Reputation points MVP Volunteer Moderator
    2022-08-03T17:03:36.813+00:00

    Hey,
    Can you please confirm whether the SQL connection is successful on lookup activity and is only failing during copy activity?
    If yes, can you please try accessing both the source and the sink databases within the Self hosted integration run time?
    because when you leverage a SHIR within either source or sink in ADF, it is a need that both the source and sink needs to be accessible via the SHIR


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.