Copy files from SFTP Server to Blob Storage with Logic App

一个人想着一个人 提交于 2019-12-24 06:55:32

问题


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?


回答1:


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

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

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.

The trigger doesn't pick up files over 50MB if the content is asked for.

For more details, you could refer to this article.



来源:https://stackoverflow.com/questions/52841231/copy-files-from-sftp-server-to-blob-storage-with-logic-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!