Azure Data Factory SFTP Linked Service: Failed to read binary packet data! (ProtocolError)

Paul Hernandez 631 Reputation points Microsoft Employee
2024-06-17T09:23:48.5933333+00:00

Hi everyone,

I'm facing a problem with a SFTP server, where some restrictions are applied to avoid the usage of RSA Keys with SHA1 signature.

I can connect without any problem to the SFTP server using WinSCP. There are no network restrictions so I can use the public IP address, a user and a public key.

If I create a linked service in Azure Data Factory of type SFTP, the connection failed with the following error message (I obfuscated the IP address due to privacy):

ErrorCode=SftpFailedToConnectToSftpServer,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Failed to connect to Sftp server 'xxx.xx.xx.246'.,Source=Microsoft.DataTransfer.ClientLibrary.SftpConnector,''Type=Renci.SshNet.Common.SshConnectionException,Message=The connection was closed by the server: Failed to read binary packet data! (ProtocolError).,Source=Renci.SshNet,'

Here the LS configuration:

User's image

I'm using the same IP, user, public key and port as in WinSCP. I would like to know what can be wrong, or could that be a bug?

Best regards,

Paul Hernandez

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,626 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,133 questions
{count} votes

1 answer

Sort by: Most helpful
  1. phemanth 8,645 Reputation points Microsoft Vendor
    2024-06-17T09:31:05.89+00:00

    @Paul Hernandez

    Thanks for the question and using MS Q&A platform.

    The error message you’re encountering suggests a connection issue with the SFTP server when using Azure Data Factory. Here are some steps you can take to troubleshoot the problem:

    • Check Authentication: Ensure that the private key content is correctly encoded. If it’s fetched from Azure Key Vault, verify that it’s base64 encoded.
    • Port Configuration: Confirm that the port number is correct and that it matches the one used by WinSCP. The standard SFTP port is 22, but your configuration might use a different one.
    • Firewall Settings: Check if the necessary port range (1024-65535) is open for data transfer under passive mode, as required by Azure Data Factory.
    • Server Compatibility: Verify that the SFTP server supports the operations you’re trying to perform. Some servers may not support certain features like renaming temp files.

    If these steps don’t resolve the issue, consider consulting the Azure Data Factory documentation for more detailed troubleshooting

    Hope this helps. Do let us know if you any further queries.

    1 person found this answer helpful.
    0 comments No comments