简体   繁体   English

蔚蓝的ftp到保管箱连接器在逻辑应用程序中不起作用

[英]azure ftp to dropbox connector not working in a logic app

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. 我正在尝试在Azure逻辑应用程序中设置新的连接器,以从FTP站点获取文件并将其移动到保管箱文件夹。

I was not even getting TO the dropbox part, although it was finding the FTP site and then deleting files. 尽管它找到了FTP站点然后删除了文件,但我什至没有进入Dropbox部分。

I have a test directory called testing off of: ftp://eek.myftpsite.com/testing/ 我有一个名为test的测试目录,它来自: 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. 我已经附上了ftp连接器及其操作的图片。 在此处输入图片说明 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. 当我将名为CSV_test2.txt的文件放到ftp文件夹中的一行文本时,将其删除一会儿-如预期的那样。 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). 但是,如果我执行显示为失败的操作(因为下一步操作不正确,则应该只是采用了文件路径的文件,例如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 欢迎任何建议,乔

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. 我以为您设置了一个FTP连接器,然后它将监视新文件,然后设置另一个FTP操作来获取每个新文件。 A bit of over thinking on my part it turns out. 事实证明,对我而言,有点过分思考了。

Nope, just feed the output directly like this: 不,只需像这样直接输入输出即可:

在此处输入图片说明

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM