admin管理员组文章数量:1125710
I am using an adf pipeline which has an if activity (inside which there is a copy data activity) how do i pass status and endtime of the copydata activity to a notebook outside if condition as base parameter
I have tried writing @activity('activity_name').output.executionDetails[0].status
in the base parameters but it said cannot find property output. When I put 2 variables inside if condition and i also kept pipeline variables with the same name and in base parameters I put @variables.status
it sent in an empty value
I am using an adf pipeline which has an if activity (inside which there is a copy data activity) how do i pass status and endtime of the copydata activity to a notebook outside if condition as base parameter
I have tried writing @activity('activity_name').output.executionDetails[0].status
in the base parameters but it said cannot find property output. When I put 2 variables inside if condition and i also kept pipeline variables with the same name and in base parameters I put @variables.status
it sent in an empty value
- are you getting the above error on failure of the copy activity? – Rakesh Govindula Commented Jan 9 at 3:23
- @RakeshGovindula nope the activity is running successfully, but i'm not able to capture status and end_time – reya Commented Jan 9 at 4:15
- I have posted the answer with reasons for the above error. Please check it and let me know. – Rakesh Govindula Commented Jan 9 at 6:30
1 Answer
Reset to default 0t said cannot find property output
The reason for this in this scenario is you are executing the set variable activity outside the if activity. When, the if condition is false
, it won't execute the copy activity inside the True activities of if activity. So, your expression involving the same copy activity will give the above error because it won't find the executed copy activity.
it sent in an empty value
Coming to this result, in this scenario, even though it stored the status value in the variable, when the True activities inside If activity itself were not executed, the default value for the variable which is empty string ''
will be passed outside the If activity. You can see I got same result upon replicating your scenario. While creating the set variable after copy activity, make sure you create it after the completion of the copy activity. It's the same for the End time of the copy activity as well.
Your pipeline flow is correct when the If activity executed the copy activity. But when it doesn't, it will send the Empty string
to the notebook parameters.
In the initialization of variables, set the copy activity status variable default value as null.
You can create another variable if_fail
and set its value to a string False activities
inside the False activities of If activity.
After the If activity, you can get the Final status which will have the values Succeeded
, Failed
or False activities
using below expression.
@if(equals(variables('status'),'null'),variables('if_fail'),variables('status'))
If copy activity executed, this will hold either Succeeded
or Failed
values based upon the copy activity execution. If it's not executed, this will hold the value False activities
value.
You can send this variable to your notebook and based on this value you can go ahead with your operations as per your requirement.
本文标签:
版权声明:本文标题:azure - Capturing output details of an activity inside if condition activity in adf, then using the output details outside if co 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736674661a1947114.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论