Azure数据工厂检索ForEach活动的状态。

huangapple go评论56阅读模式
英文:

Azure Data Factory Retrieve the status of ForEach Activity

问题

在Azure数据工厂中,是否可以检索ForEach活动的状态(成功、失败等),该活动迭代了许多项。我们希望在ForEach的OnComplete中存储ForEach的状态,然后调用存储过程。当我们尝试访问活动输出时,ForEach活动是不可用的。

英文:

Azure数据工厂检索ForEach活动的状态。
Azure数据工厂检索ForEach活动的状态。

In Azure Data Factory is it possible to retrieve the status (Succeeded, Failed etc) of a ForEach activity (that iterated over numerous items). We would like to store the status of ForEach in the OnComplete of ForEach in a stored procedure call. When we try to access activity outputs ForEach activity is not available.

答案1

得分: 1

Sure, here is the translated content:

>Azure Data Factory 获取 ForEach Activity 的状态。

ForEach activity 只是一个循环,它只迭代项目。它不提供任何输出,因此我们无法在外部获得 ForEach Activity 的活动输出。

Azure数据工厂检索ForEach活动的状态。

满足您需求的唯一方法是如下设置 On successon failure 的不同变量:

Azure数据工厂检索ForEach活动的状态。

>我们正在尝试获取 ForEach Activity(总体)的状态。

正如我们所知,如果内部活动在单次运行中失败,ForEach Activity 也会失败,因此我们可以基于此创建以下逻辑。

  • 创建追加变量活动,并使用表达式 @activity('Copy data1').output.executionDetails[0].status 从复制活动获取每次运行的状态。
    Azure数据工厂检索ForEach活动的状态。

  • 然后,在 ForEach Activity 之外创建一个设置变量,并使用表达式 @if(contains(variables('activitystatus'),'Failed'),'Failed','Succeed') 设置值为 Failed,如果 activitystatus 数组中存在 Failed,否则设置为 Succeed
    Azure数据工厂检索ForEach活动的状态。

英文:

>Azure Data Factory Retrieve the status of ForEach Activity.

Foreach activity is just a loop it only iterates the items. It does not give any output because of it we can't get foreach activity in activity output outside of it.

Azure数据工厂检索ForEach活动的状态。

The only work around to your requirement is to set different set variables for On success and on failure of foreach activity as below:

Azure数据工厂检索ForEach活动的状态。

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

As we know ForEach activity fails when the inner activity fails for a single time so based on that we can create logic below.

  • create append variable activity and get the status from the copy activity for each run with expression @activity('Copy data1').output.executionDetails[0].status
    Azure数据工厂检索ForEach活动的状态。

  • After this create a set variable outside of the foreach activity and set the value Failed if Failed is present in activitystatus array otherwise Succeed with expression @if(contains(variables('activitystatus'),'Failed'),'Failed','Succeed')
    Azure数据工厂检索ForEach活动的状态。

huangapple
  • 本文由 发表于 2023年4月19日 21:51:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76055344.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定