问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/39955257/on-prem-sql-connection-throwing-sqlexception-in-datafactory-custom-activity