Azure数据工厂选择属性“状态":“成功"来自先前的活动 [英] Azure Data Factory select property "status": "Succeeded" from previous activity
问题描述
使用Data Factory V2,我正在尝试实现从一个Azure SQL数据库到另一个Azure SQL数据库的数据复制流.
with Data Factory V2 I'm trying to implement a stream of data copy from one Azure SQL database to another.
我想执行条件活动If Condition
取决于管道先前执行的活动是否成功,但是在要包含在If Condition
活动中的表达式中,我无法选择输出属性
I would like to perform a conditional activity If Condition
depends on the success of the previous activities execute by the pipeline, but in the expression to be included in the activity of If Condition
I can not select the output property "status": "Succeeded"
.
在If Condition
活动之前,我有两个数据复制活动.
Before the activity of If Condition
I have two data copy activities.
我在流程中添加了If Condition
活动,因为复制数据后要执行的任务取决于全部复制活动的成功.
I added an If Condition
activity to my flow because the tasks to perform after copying the data depend on the success of all the copy activities.
即
如果所有复制活动均正确执行,则将执行true条件.如果只有一个复制活动成功而另一个失败,则执行错误条件
if all copy activities are performed correctly then the true condition will be executed. If only one copy activity is successful and the other fails then the false condition is executed
每个复制活动的输出如下:
The output of each copy activities is as follows:
Output
{
"dataRead": 213156,
"dataWritten": 213156,
"rowsRead": 3554,
"rowsCopied": 3554,
"copyDuration": 4,
"throughput": 52.04,
"errors": [],
"effectiveIntegrationRuntime": "DefaultIntegrationRuntime (West Europe)",
"usedDataIntegrationUnits": 4,
"usedParallelCopies": 1,
"executionDetails": [
{
"source": {
"type": "AzureSqlDatabase"
},
"sink": {
"type": "AzureSqlDatabase"
},
"status": "Succeeded",
"start": "2018-10-02T13:42:37.7396813Z",
"duration": 4,
"usedDataIntegrationUnits": 4,
"usedParallelCopies": 1,
"detailedDurations": {
"queuingDuration": 3,
"preCopyScriptDuration": 0,
"timeToFirstByte": 0,
"transferDuration": 1
}
}
]
}
我为If Condition
活动构建了表达式,如下所示:
And I structured my expression for If Condition
activity like that:
@and(equals(activity('Copy_Activity1').output.executionDetails[3],'Succeeded'), equals(activity('Copy_Activity2').output.executionDetails[3],'Succeeded'))
但是他给我以下错误:
"error": {
"code": "InvalidTemplate",
"message": "Unable to process template language expressions in action 'If Condition1' inputs at line '1' and column '1294': 'The template language expression 'and(equals(activity('Copy_Item_Budget_Name').output.executionDetails[3],'Succeeded'), equals(activity('Copy_Item_Budget_Entry').output.executionDetails[3],'Succeeded'))' cannot be evaluated because array index '3' is outside bounds (0, 0) of array. Please see https://aka.ms/logicexpressions for usage details.'."
}
但是即使有了指南,我也无法解决问题.
But even with the guide I can not solve the problem.
有人知道如何解决问题吗?谢谢
Does anyone know how to solve the problem? Thank you
推荐答案
从输出数据来看,executionDetails
是一个只有一个包含对象的项的数组.因此表达式应为:activity('Copy_Activity1').output.executionDetails[0].status
.
From the output data, executionDetails
is an array with only one item which contains an object. So the expression should be: activity('Copy_Activity1').output.executionDetails[0].status
.
这篇关于Azure数据工厂选择属性“状态":“成功"来自先前的活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!