Azure logic App中的Do-until条件未按预期工作
我有一个逻辑应用程序,它使用了Until操作。该条件检查API调用的状态: API返回这样的状态:Azure logic App中的Do-until条件未按预期工作,azure,loops,azure-logic-apps,Azure,Loops,Azure Logic Apps,我有一个逻辑应用程序,它使用了Until操作。该条件检查API调用的状态: API返回这样的状态: { "startTime": "2019-03-10T15:50:55.1278586Z", "type": "full", "status": "notStarted", "currentRefreshType": "full", "objects": [ { "table": "Table1", "partition": "Partitio
{
"startTime": "2019-03-10T15:50:55.1278586Z",
"type": "full",
"status": "notStarted",
"currentRefreshType": "full",
"objects": [
{
"table": "Table1",
"partition": "Partition_03",
"status": "notStarted"
}
]
}
我的情况不好。它运行一小时,一小时后进入下一步。但我的http请求在20分钟后接收到以下状态:
{
"refreshId": "dbxxxxxx-exxx-xxxx-xxx-3xxxxxxdaxxx",
"startTime": "2019-03-10T15:50:55.48",
"endTime": "2019-03-10T16:14:56.267",
"status": "succeeded"
}
你知道为什么我的Until操作不起作用吗?这是你的条件表达式问题。您的表达式是
“表达式”:“@equals('status','successed')”
。这意味着将字符串状态
与字符串成功
进行比较,它们永远不会相等。这就是为什么循环总是超时PT1H
。超时默认值为PT1H
,为一小时
因此,您应该获取请求主体,然后将主体中的状态与successed进行比较。流程如下所示:
响应正文是一种数组格式,因此如果您想在我的示例中获取状态,那么表达式是@body('HTTP_2')['properties']['state']
,下面是我的响应正文,您可以引用此表达式
它现在可以工作了。谢谢你的提示
{
"refreshId": "dbxxxxxx-exxx-xxxx-xxx-3xxxxxxdaxxx",
"startTime": "2019-03-10T15:50:55.48",
"endTime": "2019-03-10T16:14:56.267",
"status": "succeeded"
}