user1862876
user1862876

Reputation: 171

Azure Logic Apps FTP file content

I'm using Azure Logic Apps to copy files from FTP to Blob Storage. I'm using the action "FTP - When a file is added or modified" and after this I copy the file content to a Blob Storage.

The problem is that the file is being copied to Blob Storage before it is completely added to the FTP, and I get partial files.

Is there any way to hold Azure Logic Apps such that it will only copy the file after it is completed?

Upvotes: 2

Views: 3025

Answers (2)

Jayendran
Jayendran

Reputation: 10940

You need to Enable the Include File Content Option.

You can do this in 2 ways.
1. Go to LogicAppDesigner->Expand your FTP-Trigger ->Set yes to Include File Content

Like this

enter image description here

  1. Go to Logic App Code View-> find the Trigger JSON- > Add "includeFileContent": true inside the "Queries"

Upvotes: 2

Steven Van Eycken
Steven Van Eycken

Reputation: 566

This behavior happens when your FTP file system does not provide file locking. Similar behavior can occur when using the FTP-adapter in BizTalk.

In BizTalk, the best way to handle this is by modifying the client that is creating the file on FTP so that it uses temporary filenames.

  • Client creates file ftpFile.tmp
  • Client writes file content
  • Client renames ftpFile.tmp to ftpFile.xml or whatever extension is needed
  • BizTalk only picks up files with extension .xml

Major problem for me with the Logic Apps FTP connector is that you can't specify a file mask in the designer when using the connector as a trigger, which is strange, because i remember that option being available in the first version of logic apps.

Upvotes: 2

Related Questions