Azure Logic App 502 - "Bad Gateway" error

10,838

This error is finally resolved for me, and the problem in this case was, the new IPs (managed connectors IPs) at https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-limits-and-config#configuration-ip-addresses were not white-listed. And I also had to create a DNS record for FQDN pointing to A record (AWS SFTP folder IP address) to resolve this error.

Share:
10,838
KRM
Author by

KRM

Software programming enthusiast. Full stack .NET and Azure development experience. Also, have an experience in developing Android apps using Android Studio. Interested in Artificial Intelligence and Machine Learning.

Updated on June 05, 2022

Comments

  • KRM
    KRM almost 2 years

    Need help! I am trying to create a Logic App in Azure (Windows PaaS app service) that would connect to AWS cloud environment (SFTP Linux VM) and get files from there. In the Logic App when I am using SFTP-SSH API connection, the connection gets created, but it shows Bad Gateway error as below:

    enter image description here

    And below is what it shows when I try to run the Logic App enter image description here

    enter image description here

    I have ensured that all the IPs of my Azure PaaS app service are white-listed by AWS cloud environment (SFTP Linux VM) and I could check this by running below PowerShell command in my azure app service so seems the connection is established.

    enter image description here

    But for some reason, I can't access the SFTP folder that is present in AWS and it throws 502 Bad Gateway error. There is no other step or code that I can share, as its the very first step of my Logic App. Has anyone faced this kind of error before? Any ideas/pointers why I may be getting this error or what should I do to get rid of this error?

    Thanks for any ideas/suggestions in advance!

    • stdunbar
      stdunbar over 5 years
      You show No such host is known but then try to connect directly to an IP (based on the length of your New-Object command). Have you tried to use the hostname instead?
    • KRM
      KRM over 5 years
      @stdunbar, you are right, I see what you mean, in the New-Object powershell command when I provide the hostname instead of IP address, it shows "No such host is known". Any suggestions how to resolve this?
    • stdunbar
      stdunbar over 5 years
      Can you put the IP address into the Azure app for now? It really shouldn't matter very much either way as AWS host names include the IP address in them like ec2-XX-XX-XX-XX.us-west-2.compute.amazonaws.com.
    • KRM
      KRM over 5 years
      Thanks for the suggestion @stdunbar, when I enter the IP address (i.e. the one like XX.XXX.XX.XXX) or the AWS internal server address (i.e. the one like ec2-XX-XX-XX-XX.us-west-2.compute.amazonaws.com) in the "Host Server Address" field of the SFTP-SSH connection, it shows an error :"Please check your account info and/or permissions and try again. Details: 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 clientRequestId: XXXXXX-XXXX...
    • KRM
      KRM over 5 years
      But when I enter FQDN Name (i.e. something like xxx.sftp.xxx.domain.com), I can build the connection but then while looking for the SFTP folder, it shows 502 "Bad Gateway" "No such host is known" error like the way I have shown in screen shots in my question. What's wrong here any ideas?
    • stdunbar
      stdunbar over 5 years
      Are you positive that your Amazon resource is allowing port 22 (the SSH port)? Amazon has security groups which are similar in concept to an Azure network security group. By default no connections are allowed on any port.
    • KRM
      KRM over 5 years
      Yes, Amazon has confirmed that they opened port 22. And they also recommended to use FQDN to connect because it’s a cluster hosted on 2 servers so they have two different IPs and the FQDN can point to any of these servers. Thanks as always for your helpful comments!