Trying to send a file from ADF blob storge to SFTP server but getting an error

Nilesh Tayde 0 Reputation points
2024-07-01T13:35:28.1766667+00:00

Getting an error - SocketErrorCode: 'ConnectionReset'.,Source=Microsoft.DataTransfer.ClientLibrary.SftpConnector,''Type=System.Net.Sockets.SocketException,Message=An existing connection was forcibly closed by the remote host,Source=Renci.SshNet,'

while sending file from blob storage to SFTP

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,918 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,811 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Amrinder Singh 5,155 Reputation points Microsoft Employee
    2024-07-01T14:10:54.9866667+00:00

    Hi Nilesh Tayde - Thanks for reaching out.

    Can you please elaborate on the ask.

    Are you trying to connect to Azure Blob Storage (SFTP enabled) via ADF OR you are trying to connect from Blob storage using ADF to 3rd party SFTP server?

    Is it a working setup with intermittent error or a new setup?

    One isolation step is to enable logging and verify if you are able to Read the data from storage successfully (GET request). If the calls are successful the issue is probably with ADF not able to connect to 3rd party SFTP server,

    Either ways, I would recommend raising a support ticket with ADF team to help verifying the connectivity and take it ahead.

    Hope that helps!


  2. Nehruji R 8,146 Reputation points Microsoft Vendor
    2024-07-02T08:53:21.5666667+00:00

    Hello Nilesh Tayde,

    Greetings! Welcome to Microsoft Q&A Platform.

    Adding to above information, I understand that you’re encountering a SocketErrorCode: ‘ConnectionReset’ issue while copying data from Azure Blob Storage to an SFTP server, along with the System.Net.Sockets.SocketException—indicates that the connection to the SFTP server was forcibly closed by the remote host. Please consider checking the following factors to resolve the issue.

    Ensure that the SFTP server is reachable from your Azure Data Factory (ADF) environment. Check if there are any network issues or firewalls blocking the connection and verify that the SFTP server is running and accepting connections on the specified port (usually port 22 for SFTP).

    SFTP Connection Issue, it could be due to networking issue on your SHIR hosted machine. Please validate your SHIR hosted machine network settings to allow connection to your sink SFTP server.

    If you enable "enabled from selected virtual networks and IP addresses" and configured firewall(not using Vnet) then you can enable "Allow Azure services on the trusted services list to access this storage account." to access the SFTP storage account via ADF. Please see the below blog for more details.

    Similar thread for reference - https://learn.microsoft.com/en-us/answers/questions/1344760/facing-socket-connection-error-while-copying-data

    Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.


    Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.