简体   繁体   English

Azure逻辑应用程序HTTP请求500

[英]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. 我是Azure Logic应用程序的新手,因此此示例可能看起来没那么有用,而仅仅是学习一些基本的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. 我有一个简单的HTTP侦听器(当收到HTTP请求时),它应该向另一个服务发送另一个HTTP GET请求并将响应发送给第一个调用者。 It looks like this: http://imgur.com/a/9fpfu 看起来像这样: http : //imgur.com/a/9fpfu

Now everything is working great until i send wrong data or somehow the Logic apps get a 500 HTTP error from the HTTP requests. 现在一切正常,直到我发送错误数据或以某种方式Logic应用从HTTP请求中收到500 HTTP错误为止。

Than the Logic app hangs in the HTTP request for around 1 minute and fails. 比Logic应用程序在HTTP请求中挂起大约1分钟而失败。 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? 如何将Logic应用返回的请求转发给请求逻辑应用的请求者?

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. 如您所知,500是一个未知错误,因此,即使在重试后,logicapp引擎也会停止处理任何仍会抛出500的动作。 For this specific case you need to setup logicapp diagnostics rule "Actions Failed"/"Runs Failed". 对于这种特定情况,您需要设置logicapp诊断规则“操作失败” /“运行失败”。 In the rule you can configure sending an email and/ configure a webhook to react to the event 在规则中,您可以配置发送电子邮件和/或配置Webhook以响应事件

Logic Apps would retry any failing request 4 times by default, hence you see increased runtime when the http service returns error 5xx. Logic Apps默认会重试任何失败的请求4次,因此,当http服务返回错误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/ 查看更多https://azure.microsoft.com/zh-cn/updates/customizable-retry-policies-in-logic-apps/

By default, Logic App steps have a dependency on the success of any dependent actions. 默认情况下,Logic App步骤依赖于任何相关操作的成功与否。 This results in your response action being skipped when the http action fails. 当http操作失败时,这会导致您的响应操作被跳过。

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属性,以便无论http操作成功与否都可以运行该操作

     "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 在http操作的http状态代码上向您的Logic Apps添加条件,然后针对每种情况设置专用的Response操作

You can update retry policy and timeout setting of Http action as 您可以将Http操作的重试策略和超时设置更新为

enter image description here 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM