如果 ADF Pipeline 运行超过 10 分钟如何发送邮件

问题描述 投票:0回答:1

只要我的管道运行时间超过 10 分钟,我就需要发送电子邮件。为了发送邮件,我使用逻辑应用程序,但如何检查时间是否超过 10 分钟?我们如何在管道本身中检查并执行此操作?谁能帮我解决这个问题

azure azure-data-factory pipeline oracle-adf
1个回答
0
投票

要在 ADF Pipeline 运行时间超过 10 分钟时发送邮件,请使用与主管道并行的等待活动,并在等待活动中设置等待 10 分钟(600 秒)的时间(以秒为单位)

enter image description here

之后,使用 Rest Api 通过 Web 活动获取管道状态

URL: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelineruns/@{pipeline().RunId}?api-version=2018-06-01

enter image description here

然后在 If 活动中,管道运行的状态为 In Progress,带有表达式

@equals(activity('Web1').output.value.status,'In progress')
,然后使用 Web 活动(逻辑应用)发送邮件

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.