Frank
Frank

Reputation: 11

AZure Logic Apps SFTP Connector reply 504 bad gateway

Can anyone help with this, I was trying to connect to a SFTP server with password, and after the SFTP SSH connector with "When a file is added or modified", I can view the directory in design mode, but when it's running, the response from SFTP server seems not right and the error is 504 shown as below:

        "error": {
            "code": 504,
            "source": "logic-apis-australiasoutheast.azure-apim.net",
            "message": "BadGateway",
            "innerError": {
                "status": 504,
                "message": "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond",
                "error": {
                    "message": "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
                },
                "source": "sftpwithssh-ase.azconn-ase.p.azurewebsites.net"
            }

I can connect to the SFTP server via WinSCP or FileZilla and browsing, downloading without any issue. Please help if you encounter with this and solved. Thanks.

Upvotes: 1

Views: 5138

Answers (2)

Tony Moore
Tony Moore

Reputation: 11

I had the same problem, but have overcome it in a sense. When looking at the deployment template, I found the following under triggers:

"triggers":{
  "recurrence":{
     "frequency":"Hour",
     "interval":"1"
     },
     "metadata":{
       "L2RhdGEvZGV2L2luL3BhcnRuZXI=" : "['parameters(sftpwithssh_root_folder')]"
  • Root folder is in Key Vault,
  • Dev is "/data/dev/in/partner",
  • QA is "/data/qa/in/partner".

On deployment, from the template, the metadata property is set from the parameters, but the NAME ("L2RhdGEvZGV2L2luL3BhcnRuZXI=") is not, and the name is the Base64 representation of the folder. (Try it and see.) So if you deploy the template to QA, you will get a mismatch between the parameter and the base64 name.

Edit the logic app code and change the metadata name to the base64 encoded QA folder ("L2RhdGEvcWEvaW4vcGFydG5lcg=="), save it, and everything will work as expected.

Upvotes: 0

Hury Shen
Hury Shen

Reputation: 15744

For this problem, I summarize some possible causes below for your reference:

1. Check if the address is correct. If you use hostname, try to use the server's IP address instead of hostname.

2. Check if the server's firewall is blocking the request from your logic app. Check the if the IP of your logic app in the whitelist of your server firewall.

3. Check if the port you use in logic app is blocked by the server.

Upvotes: 0

Related Questions