1

I have added code for Azure datafactory custom activity in Azure batch service and pointed the datafactory pipeline to the bacth service. When I execute the code in local environment, it works fine. But when I upload it to run in azure batch service, it throws and sqlexception

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.

Nuri Tasdemir
  • 9,720
  • 3
  • 42
  • 67
Maverik
  • 411
  • 4
  • 22
  • I would guess there is no line of sight from the cloud batch service to the On-prem SQL Server. Using the built-in components to connect from cloud to on-prem, this would have to go through a Data Management Gateway. Have you coded the equivalent in custom code? To put it another way, what reason do you have to believe the cloud batch service can "see" your on-prem SQL Server? – wBob Oct 10 '16 at 11:09
  • As the code is running on azure bacth service, is it necessary to have a data management gateway. Shouldn't the code be able to access the sql server as if the code was running on some cloud service VM? – Maverik Oct 10 '16 at 12:35

1 Answers1

3

Today, Custom activity cannot access on-prem resource. The data movement gateway can only be used on copy\Sproc activity scenario, and it doesn’t have interface to execute customer’s code.

The solution here is: Try copy activity to copy your data to azure storage or other public cloud can access. Then run custom activity. Otherwise you can try vNet and ExpressRoute to connect your Azure public cloud with your onprem environment.

Charles Gu
  • 59
  • 2