onefox
onefox

Reputation: 177

Azure Logic App HTTP request 500

I am new to the Azure Logic Apps so this example may look not that useful but its just to learn some basic Azure Logic.

I got a simple HTTP listener (When an HTTP request is received) Than it should send another HTTP GET request to some service and send a response to the first caller. It looks like this: https://i.sstatic.net/sVQOR.jpg

Now everything is working great until i send wrong data or somehow the Logic apps get a 500 HTTP error from the HTTP requests.

Than the Logic app hangs in the HTTP request for around 1 minute and fails. The Response after that is never send.

How can i forward the response that the Logic app is getting back to the requester who requested the logic app?

Upvotes: 0

Views: 3097

Answers (3)

Sonu Kumar
Sonu Kumar

Reputation: 9

You can update retry policy and timeout setting of Http action as

enter image description here

Upvotes: 1

TusharJ
TusharJ

Reputation: 1263

As you know 500 is something an unknown error and hence logicapp engine stops processing any actions which keep throwing 500 even after the retry. For this specific case you need to setup logicapp diagnostics rule "Actions Failed"/"Runs Failed". In the rule you can configure sending an email and/ configure a webhook to react to the event

Upvotes: 0

Szymon Wylezol
Szymon Wylezol

Reputation: 1466

Logic Apps would retry any failing request 4 times by default, hence you see increased runtime when the http service returns error 5xx. You can configure this behaviour using a custom retry policy. See more https://azure.microsoft.com/en-us/updates/customizable-retry-policies-in-logic-apps/

By default, Logic App steps have a dependency on the success of any dependent actions. This results in your response action being skipped when the http action fails.

You have a couple of options to solve this:

  1. In code view, you can update the runAfter property so that the action runs regardless of whether the http action succeeded or not

    "runAfter": { "Condition": [ "Succeeded", "Failed" ] }
    
  2. Add a condition to your Logic Apps on the http status code of the http action, and then have a dedicated Response action for each case

Upvotes: 2

Related Questions