使用Logic App将文件从SFTP服务器复制到Blob存储 [英] Copy files from SFTP Server to Blob Storage with Logic App

查看:104
本文介绍了使用Logic App将文件从SFTP服务器复制到Blob存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用逻辑应用程序将文件从SFTP服务器复制到Blob存储.逻辑应用程序每3分钟由重复发生"块触发,并检查服务器上有哪些文件以进行复制.要检查服务器上有哪些文件,我使用列出文件夹中的文件"块.复制本身是通过管道运行来执行的.到目前为止,此方法工作正常,但我面临一个问题.如果在触发逻辑应用程序期间,一个文件仍在sftp服务器上的上载过程中,则仅将文件(.txt)已在sftp服务器上的部分复制到Blob存储中.文件的其余部分丢失了,因为我在将文件复制到Blob后将其删除.我正在寻找一个仅复制完全上传到sftp服务器的文件的选项.有人知道如何使用逻辑应用程序执行此操作吗?

I want to copy files from an SFTP server to an blob storage by using a logic app. The logic app is triggered by a "recurrence" block every 3 minutes and checks which files are on the server in order to copy them. To check which files are on the server I use the "list files in folder" block. The copying itself is performed by a pipeline run. This works fine so far, but I'm facing one problem. In case one file is still in the uploading process on the sftp server during the logic app is triggered, only the part of the file (.txt) that is already on the sftp server gets copied to the blob storage. The rest of the file gets lost, as I'm deleting files after copying them to the blob. I'm looking for an option to copy only files that have been uploaded completely to the sftp server. Does somebody have an idea how to do this with a logic app?

推荐答案

我正在寻找仅复制完全上传到sftp服务器的文件的选项.

I'm looking for an option to copy only files that have been uploaded completely to the sftp server.

正如Thomas所说,您可以尝试使用名为When a file is added or modified的SFTP触发器来实现所需的功能.

As Thomas said, you could try to use the SFTP trigger called When a file is added or modified to achieve what you want.

触发器通过轮询SFTP文件系统,并查找自上次轮询以来已已被修改的任何文件来工作.某些工具允许保留文件修改时间.

The triggers work by polling the SFTP file system, and looking for any file which has been modified since the last poll. Certain tools allow the file modification time to be preserved.

当触发器遇到新文件时,它将尝试确保新文件被完全写入.例如,有可能正在编写或修改文件,并且在触发器轮询文件服务器时正在进行更新.为了避免返回包含部分内容的文件,触发器将记下最近修改的此类文件的时间戳,但不会立即返回这些文件.仅当触发器再次轮询时,才会返回这些文件.有时,这可能会导致最多两次触发轮询间隔的延迟.

When the triggers encounter a new file, it will try to ensure that the new file is completely written. For instance, it is possible that the file is being written or modified, and updates are being made at the time the trigger polled the file server. To avoid returning a file with partial content, the trigger will take note of the timestamp such files which are modified recently, but will not immediately return those files. Those files will be returned only when the trigger polls again. Sometimes, this may lead a delay up to twice the trigger polling interval.

如果要求内容,则触发器不会获取超过50MB的文件.

有关更多详细信息,您可以参考此文章.

For more details, you could refer to this article.

这篇关于使用Logic App将文件从SFTP服务器复制到Blob存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆