title: Azure Logic App 502 - "Bad Gateway" error
body: <p>Need help! I am trying to create a <strong>Logic App</strong> in <strong>Azure</strong> (Windows PaaS app service) that would connect to AWS cloud environment (SFTP Linux VM) and get files from there. In the <strong>Logic App</strong> when I am using SFTP-SSH API connection, the connection gets created, but it shows <strong>Bad Gateway</strong> error as below:</p>
  
  <p><a href="https://i.stack.imgur.com/sBLl6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sBLl6.png" alt="enter image description here"></a></p>
  
  <p>And below is what it shows when I try to run the <strong>Logic App</strong>
  <a href="https://i.stack.imgur.com/TnuQp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TnuQp.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Fo4cN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fo4cN.png" alt="enter image description here"></a></p>
  
  <p>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. </p>
  
  <p><a href="https://i.stack.imgur.com/pfOOo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pfOOo.png" alt="enter image description here"></a></p>
  
  <p>But for some reason, I can't access the SFTP folder that is present in AWS and it throws 502 <strong>Bad Gateway</strong> error. There is no other step or code that I can share, as its the very first step of my <strong>Logic App</strong>. 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?</p>
  
  <p>Thanks for any ideas/suggestions in advance!</p>