Azure Data factory Copy Data Job failing - ErrorCode=SqlFailedToConnect,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Cannot connect to SQL Database.

TOWNSON, James 0 Reputation points
2023-07-04T15:32:57.1433333+00:00

Hi,

I have added an Azure SQL server to Azure Data Factory as a Linked Service. I can connect to it and preview the data in Azure Data Factory without issue. I can also trigger Stored Procedures on the Azure SQL server which includes adding dummy data to a landing table.

However If I try and use the linked server as a Copy Data activity it fails with the following error:

ErrorCode=SqlFailedToConnect,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Cannot connect to SQL Database. Please contact SQL server team for further support. Server: 'XYZ', Database: XYZ: 'XYZUser'. 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 - No such host is known.),Source=.Net SqlClient Data Provider,SqlErrorNumber=11001,Class=20,ErrorCode=-2146232060,State=0,Errors=[{Class=20,Number=11001,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 - No such host is known.),},],''Type=System.ComponentModel.Win32Exception,Message=No such host is known,Source=,'

This doesn't make any sense as I can preview data on the server and trigger stored procedures so why won't it connect to the same server and run a Copy Job

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

1 answer

Sort by: Most helpful
  1. Pratik Somaiya 4,211 Reputation points Volunteer Moderator
    2023-07-04T17:05:49.09+00:00

    Hi TOWNSON, James

    Is the IR used in the source of your copy activity able to access the sink? I observed kind of similar issue wherein user was able to preview the data but the copy activity was failing, when the Azure SQL was whitelisted on the Self Hosted IR of source, the copy activity executed successfully

    Thanks


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.