问题描述

使用标准版的Azure Logic App服务,可以创建多个工作流(workflow),如果在启用/禁用其它的工作流时,是否会对正在运行其它工作流造成影响呢?

【Azure Logic App】在逻辑应用中开启或关闭一个工作流是否会对其它工作流产生影响呢?_App

 

问题解答

在实际的测验中,我们得到的答案是:会造成影响!在Disabled/Enabled同一个Logic App中的Workflow时,正在运行的Workflow会受到影响!

一般影响:导致 Workflow 的执行时间变长

示例中的workflow正常执行时间为 70毫秒以内,但是在Disabled workflow期间,执行时间达到 3 秒。

【Azure Logic App】在逻辑应用中开启或关闭一个工作流是否会对其它工作流产生影响呢?_执行时间_02

 

严重情况:导致 Workflow 的执行失败

【Azure Logic App】在逻辑应用中开启或关闭一个工作流是否会对其它工作流产生影响呢?_App_03

 

问题原因

在操作 Disabled / Endabled workflow的时候,Logic App会在环境变量中添加配置 Workflows.<workflowname>.FlowState = Disabled 项。 而在 App Service / Function App / Logic App 服务中,当修改配置项时,都会导致应用程序重启。

【Azure Logic App】在逻辑应用中开启或关闭一个工作流是否会对其它工作流产生影响呢?_App_04

而在重启过程中,会对正在运行的workflow产生延迟影响,会等待重启完成后继续执行。所以如果 Workflow 中的某些action有时效性的要求,就会出现 Timeout 错误,最终使得 Workflow 执行失败。

查看错误信息

{
    "statusCode": "BadRequest",
    "body": {
        "code": "ServiceProviderActionFailed",
        "message": "The service provider action failed with error code 'BadRequest' and error message 'The lock supplied is invalid. 
		      Either the lock expired, or the message has already been removed from the queue. For more information please see https://aka.ms/ServiceBusExceptions . 
		      Reference:3f066769-xxxx-xxxx-xxxx-1764591edcd1, 
		      TrackingId:953e2bcb-xxxx-xxxx-xxxx-bc63237cc7de_B1, 
		      SystemTracker:lbsbtest01:Queue:xxxxxxxxxxx, 
		      Timestamp:2024-08-24T09:47:15 (MessageLockLost). 
		      For troubleshooting information, 
		      see https://aka.ms/azsdk/net/servicebus/exceptions/troubleshoot.'."
    }
}

 

参考资料

禁用或启用逻辑应用资源:https://docs.azure.cn/zh-cn/logic-apps/manage-logic-apps-with-azure-portal?tabs=standard#disable-enable-logic-apps

 

 

 

当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!