Azure data factory: Handling inner failure in until/for activity

可紊 提交于 2020-06-29 03:48:14

问题


I have an Azure data factory v2 pipeline containing an until activity.

Inside the until is a copy activity - if this fails, the error is logged, exactly as in this post, and I want the loop to continue.

Azure Data Factory Pipeline 'On Failure'

Although the inner copy activity’s error is handled, the until activity is deemed to have failed because an inner activity has failed.

Is there any way to configure the until activity to continue when an inner activity fails?


回答1:


Solution

Put the error-handling steps in their own pipeline and run them from an ExecutePipeline activity. You'll need to pass-in all the parameters required from the outer pipeline.

You can then use the completion (blue) dependency from the ExecutePipeline (rather than success (green)) so the outer pipeline continues to run despite the inner error.

Note that if you want the outer to know what happened in the inner then there is currently no way to pass data out of the ExecutePipeline to its parent (https://feedback.azure.com/forums/270578-data-factory/suggestions/38690032-add-ability-to-customize-output-fields-from-execut).

To solve this, use an sp activity inside the ExecutePipeline to write data to a SQL table, identified with the pipeline run id. This can be referenced inside the pipeline with @pipeline().RunId.

Then outside the pipeline you can do a lookup in the SQL table, using the run ID to get the right row.

HEALTH WARNING:

For some weird reason, the output of ExecutePipeline is returned not as a JSON object but as a string. So if you try to select a property of output like this @activity('ExecutePipelineActivityName').output.something then you get this error:

Property selection is not supported on values of type 'String'

So, to get the ExecutePipeine's run ID from outside you need: @json(activity('ExecutePipelineActivityName').output).pipelineRunId

I couldn't find this documented in Microsoft's documentation anywhere, hence posting gory details here.



来源:https://stackoverflow.com/questions/62001161/azure-data-factory-handling-inner-failure-in-until-for-activity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!