Skip to content

[BC Idea]: SFTP module using 3rd party library #3686

@joandrsn

Description

@joandrsn
Contributor

BC Idea Link

https://experience.dynamics.com/ideas/idea/?ideaid=e5c376ed-2e73-ea11-99e5-0003ff68dcc1

Description

We are considering adding support for SFTP using SSH.NET as a module. SFTP supported has also been discussed on microsoft/ALAppExtensions#268.
Maybe it could be hooked into the External File Storage Module.

However, that would involve BC shipping with this module (DLL file).
Is this even possible considering the security of the platform?
Nuget package: https://www.nuget.org/packages/ssh.net/

Please note that while the BCIdea talks about FTP and SFTP, they are very different.
FTP can simply be implemented using dotnet's FtpWebRequest, but we really want SFTP.

I will provide the implementation for this BC Idea

  • I will provide the implementation for this BC Idea
    Internal work item: AB#351397

Activity

added theissue type on May 14, 2025
linked a pull request that will close this issue on May 17, 2025
JesperSchulz

JesperSchulz commented on May 19, 2025

@JesperSchulz
Contributor

@joandrsn, we have historically rejected contributions which require external assemblies. The security review needed to get such external DLLs approved requires significant effort, which we cannot prioritize. But let me double check for this specific case and not just blindly reject it.

joandrsn

joandrsn commented on May 19, 2025

@joandrsn
ContributorAuthor

Thank you for the feedback @JesperSchulz. I look forward to hearing the verdict.

To ellaborate further on why it's important to us:
We have a concrete need for SFTP to integrate to the following two services.
MasterCard integration (Sending payments to peoples bank accounts)
https://www.mastercardpaymentservices.com/denmark/my-file-transfer/sftp
eIndkomst - The danish tax authority (Send income information)
https://skat.dk/erhverv/ansatte-og-loen/indberet-loen-eindkomst/saadan-indberetter-du-loen-eindkomst/vejledninger-til-eindkomst-mq-og-sfg

We as BC partner do not want to have such a service on our end (Minimization of personal data), but we are losing to solutions which have SFTP integration.
The customer could have this service, but it makes it difficult to debug the service.

The topic seems rather popular in the community:
https://community.dynamics.com/forums/thread/details/?threadid=b1713d0a-344f-ee11-be6f-00224827e5d4
https://demiliani.com/2020/03/30/dynamics-365-business-central-saas-save-a-file-to-an-sftp-server/
https://appsource.microsoft.com/da-dk/product/dynamics-365-business-central/pubid.inventio-it%7Caid.smartftp%7Cpappid.d44b9538-3ba3-4a31-adf1-feefaa0b1808?tab=overview
https://ivansingleton.dev/how-to-read-files-via-sftp-in-business-central/
https://madhda.com/it-blog/integration-of-business-central-with-sftp-server-add-xml-file-on-sftp-server-using-azure-function-app/

Drakonian

Drakonian commented on May 23, 2025

@Drakonian
Contributor

I fully support the SFTP module in BC. Very often I have to use Azure Function to support SFTP and it is very inconvenient.

But I would also be very careful with the implementation. From my experience SFTP is a very slow and not very stable protocol when transferring multiple files. It is very easy to get an internal server too many requests error or something like that.

Coming back to the slow speed of working with files. I would implement the possibility of parallel data streams. I have done this for my projects to somehow speed up file transfer, even some 5 threads will speed up the process 5 times.

JesperSchulz

JesperSchulz commented on May 23, 2025

@JesperSchulz
Contributor

@joandrsn, based on your elaborate scenario descriptions and the solid draft PR, we have decided to move forward with your PR 🥳 I will in the coming weeks add the assembly to our server, after we've got security sign off (in progress already). You may proceed with completing the PR. For obvious reasons, your PR will not compile here on GitHub yet, but that should change soon 😉

I will be busy the coming two weeks and won't find much time to look further into this, but I'll be on this at some point in June - in due time for the 2025 wave 2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ApprovedThe issue is approvedBCIdeaIssue related to a BCIdeaIntegrationGitHub request for Integration areaLinkedIssue is linked to a Azure Boards work item

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @joandrsn@Drakonian@JesperSchulz

      Issue actions

        [BC Idea]: SFTP module using 3rd party library · Issue #3686 · microsoft/BCApps