gpt4 book ai didi

Azure数据工厂检索ForEach事件的状态

转载 作者:行者123 更新时间:2023-12-03 06:18:29 25 4
gpt4 key购买 nike

enter image description here enter image description here

在 Azure 数据工厂中,可以检索 ForEach 事件(迭代多个项目)的状态(成功、失败等)。我们希望在存储过程调用中将 ForEach 的状态存储在 ForEach 的 OnComplete 中。当我们尝试访问事件输出时,ForEach 事件不可用。

最佳答案

Azure Data Factory Retrieve the status of ForEach Activity.

<强> Foreach activity只是一个循环,它只迭代项目。它不提供任何输出,因为我们无法在其外部的事件输出中获取 foreach 事件。

enter image description here

满足您的要求的唯一解决方法是为 foreach 事件的成功失败设置不同的设置变量,如下所示:

enter image description here

We are trying to get the status of the foreach activity (overall).

正如我们所知,当内部事件失败一次时,ForEach 事件就会失败,因此我们可以创建下面的逻辑。

  • 创建追加变量事件并使用表达式 @activity('Copy data1').output.executionDetails[0].status 获取每次运行的复制事件的状态 enter image description here

  • 此后,在 foreach 事件外部创建一个设置变量,如果 Failed 出现在 activitystatus 数组中,则设置值 Failed否则使用表达式@if(contains(variables('activitystatus'),'Failed'),'Failed','Succeed')成功 enter image description here

关于Azure数据工厂检索ForEach事件的状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76055344/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com