CodexBloom - Programming Q&A Platform

Trouble with Azure Logic Apps and HTTP Request Trigger Returning 502 Bad Gateway

👀 Views: 55 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-12
azure logic-apps http-request JSON

I'm updating my dependencies and I'm collaborating on a project where I'm currently working on an Azure Logic App that is supposed to trigger an HTTP request to an external API whenever a new blob is created in Azure Blob Storage. However, I'm receiving a '502 Bad Gateway' behavior when the Logic App tries to execute the HTTP request. I checked the external API and it is up and running, but it seems like there might be an scenario with how the Logic App is configured. Here's a snippet of the HTTP action I set up in the Logic App: ```json { "type": "Http", "inputs": { "method": "POST", "uri": "https://api.example.com/endpoint", "headers": { "Content-Type": "application/json", "Authorization": "Bearer <token>" }, "body": { "blobUrl": "@{triggerOutputs()?['body']['url']}", "blobName": "@{triggerOutputs()?['body']['name']}" } } } ``` I've verified the endpoint URL and the authorization token, and both are definitely valid. I set the request timeout to 1 minute to ensure that it's not timing out prematurely. I also checked the Logic App's run history, and it indicates that the action is failing with a 502 behavior. To troubleshoot, I added a `Response` action before the HTTP request to log the output of the trigger, which seems to be working correctly and displaying the expected blob information. I also tried adding a retry policy to the HTTP action, but the behavior continues. One thing I noticed in the Azure portal is that the Logic App is running in the Standard tier, which I thought should provide enough capability for this setup. Could there be something specific about the HTTP action configuration or the way Logic Apps handle external requests that I'm missing? Any help or insights would be greatly appreciated! This is for a REST API running on Windows 10. I'm working on a web app that needs to handle this. Any advice would be much appreciated.