azure ftp to dropbox connector not working in a lo

2019-08-08 02:40发布

I figured the below out about an hour after posting. There are not many examples out there yet so I left this up.

I am trying to setup a new connector in a Azure Logic App to get files from a FTP site and move them to a dropbox folder.

I was not even getting TO the dropbox part, although it was finding the FTP site and then deleting files.

I have a test directory called testing off of: ftp://eek.myftpsite.com/testing/

I am obviously not understanding something fundamental to this process here. I have attached a picture of the ftp connector and it action. enter image description here Here is the code for the trigger:

   "operation": "TriggerOnFileAvailable",
            "parameters": {
                "triggerState": "@coalesce(triggers()?.outputs?.body?['triggerState'], '')",
                "FolderPath": "testing",
                "FileMask": "CSV*",
                "FileType": "Text"

And the code for the action (this part turned out to be not needed):

   "operation": "GetFile",
            "parameters": {
                "FilePath": "@{triggers().outputs.body.FilePath}",
                "FileType": "Text"
            },
            "authentication": {
                "type": "Raw",
                "scheme": "Zumo",

When I drop a file named CSV_test2.txt with one line of text in it in the ftp folder, after a short bit it is removed - as expected. If I go to the trigger history it shows it fired successfully. The outputs from the trigger looks correct as well (turns out it was):

  "body": {
    "FileName": "CSV_test2.txt",
    "FolderPath": "testing",
    "FilePath": "testing\\CSV_test2.txt",
    "ServerAddress": "eek.myftpsite.com",
    "Content": "This is the data in the test file.",
    "ContentTransferEncoding": "None",
    "triggerState": "CSV_test2.txt"
}

But if I go to the actions it shows as failed (because I had the wrong next step, it should have just been something that takes a filepath, like dropbox). The inputs for the actions show:

   "operation": "GetFile",
"parameters": {
    "FilePath": "testing\\CSV_test2.txt",
    "FileType": "Text"
},
"apiVersion": "2015-01-14",
"authentication": {
    "scheme": "Zumo",
    "type": "Raw"
}

Which seems like it is correct to me (nope). The outputs shows:

    },
"body": {
    "status": 404,
    "source": "https://ftpconnectora4cf805ee5114235ad1c43445a153673.azurewebsites.net/file/testing/CSV_test2.txt?FileType=Text",
    "message": "Path does not exist on FTP Server. The remote server returned an error: (550) File unavailable (e.g., file not found, no access)."
}

I have tried every combination of things I can think of, including just hardcoding the path and file name -- all to no avail. I am really wanting to try to get this working on a new project vs doing it the "old" way.

Any suggestions are welcome, Joe

1条回答
劫难
2楼-- · 2019-08-08 03:16

I had a misunderstanding of how it worked. I thought you setup a FTP connector and which would then monitor for new files, then you setup another FTP action to get each new file. A bit of over thinking on my part it turns out.

Nope, just feed the output directly like this:

enter image description here

The code for it is:

 "operation": "UploadFile",
            "parameters": {
                "FilePath": "@{triggers().outputs.body.FilePath}",
                "content": {
                    "Content": "@{triggers().outputs.body.Content}",
                    "ContentTransferEncoding": "None"
                },
                "overwrite": true

Pretty cool...I am leaving my muddling about up there in the hopes that it helps somebody else out. This is all pretty new stuff, but pretty exciting.

Thank you,

Joe

查看更多
登录 后发表回答