将数据从私有 Vnet 中的 Postgresql 写入 Azure SQL 数据库的 Azure 数据工厂问题

Azure data factory problem to write data from a Postgresql in private Vnet to Azure SQL Database

我正在尝试从位于 azure VM 上托管的 postgresql 数据库中的 table 检索数据。我想将此数据注入 Azure SQL 数据库。我设置了自托管集成运行时。由于托管我的数据库的虚拟机是一个 linux 虚拟机,我在 windows 虚拟机上设置了自托管 IR 并使用它我能够连接到数据库并将数据复制到 ABS 位置没有任何问题但是当我尝试将相同的数据复制到 SQL 数据库时,出现以下错误:

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 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 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.),

Source=.Net SqlClient Data Provider,SqlErrorNumber=10060,Class=20,ErrorCode=-2146232060,State=0,Errors=[{Class=20,Number=10060,State=0,Message=A network-related or instance-specific error occurred while establishing a connection to SQL Server. ...

搜索后,我在托管 IR 的机器上打开了端口 1433 的入站和出站流量,并在托管数据库的机器上打开了端口 1433 的出站流量,但我仍然遇到相同的错误。

知道我错过了什么吗?

我设法解决了这个问题。根据 Azure 文档 here,如果我们尝试从 Azure 云中连接到 SQL 数据库,那么我们需要打开与端口范围 11000-11999 的通信。我们需要将此端口范围放入出站连接的网络安全列表中。