A VM is connected to SQL Server using vpn and I have done port forwarding of the SQL Server ip with the windows 11 virtual machine VM1 ip.
SQL Server ip:1433 ====>> VM1 ip:1433
netsh interface portproxy
add v4tov4 listenaddress=VM1 ip listenport=1433
connectaddress=sql server ip connectport=1433
Another virtual machine VM2 in same subnet with VM1 after turning off the firewall and whitelisting the subnet ip with the port, the VM2 can connect with the database.
And I have created the data factory in azure with a private endpoint in same subnet.
The problem is when I try to connect VM1 from data factory with Azure runtime enabled and SQL Server authentication I cannot connect:
Cannot connect to SQL Database. Please contact SQL server team for further support. Server: 'vm1ip', Database: 'dbname', User: 'username'. Check the linked service configuration is correct, and make sure the SQL Database firewall allows the integration runtime to access.
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), SqlErrorNumber=53,Class=20,State=0,
The network path was not found
but if I expose the VM1 1433 port in internet the datafactory can make a connection.
Any solution for this?
As per this Ms Document below are the possible solutions to resolve the above error:
It tested successfully after following above steps:
For more information you can refer this.