Azure Data Factory - Azure SFTP storage account connectivity error: Failed to connect to Sftp server 'sftpstorage.blob.core.windows.net'. The connection was closed by the server:

Jora Singh Randhawa 6 Reputation points
2022-12-15T13:36:09.873+00:00

While trying to establish a connection (linked service) from Azure Data Factory to an SFTP storage account I get the mentioned error. My settings are "enabled from selected virtual networks and IP addresses" in the SFTP account. It works fine when i enable from all networks. I assume the problem is with the setting "public network access", cause the connection to WinSCP works fine. I also get an error when connecting to SFTP with cloud shell: ![![271009-image.png][1]][1] [1]: /api/attachments/271111-image.png?platform=QnA Does anyone know how to fix this?

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,523 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,611 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jora Singh Randhawa 6 Reputation points
    2022-12-20T09:39:29.813+00:00

    Thanks for the help, I managed to connect to the sftp account by enabling managed private network on the default AutoResolveIntegrationRuntime when deploying ADF.
    Then I created a managed private endpoint in ADF and approved the connection in the storage account (under networking/private endpoint connections).

    1 person found this answer helpful.

  2. Bhargava-MSFT 31,256 Reputation points Microsoft Employee Moderator
    2022-12-15T21:10:33.01+00:00

    Hello anonymous user,

    Welcome to the MS Q&A platform.

    The issue seems like your ADF is not in the same Vnet as the SFTP storage account. This is the reason for the error.

    To resolve this, You can add the ADF in the same Vnet (or) white-list the data factory IP address. But ADF will keep on adding the IP addresses, so it's hard to track and add IP addresses.

    The best approach is to add the same Vnet to ADF.

    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.

    https://techcommunity.microsoft.com/t5/azure-data-factory-blog/data-factory-is-now-a-trusted-service-in-azure-storage-and-azure/ba-p/964993

    I hope this helps. Please let me know if you have any further questions.

    271192-image.png


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.