MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.3k stars 21.48k forks source link

Feedback : Get error details if any of the Sequential activity fails in an ADF pipeline #124879

Open GovindulaRakesh opened 3 days ago

GovindulaRakesh commented 3 days ago

Document Enhancement Proposal: Get error details if any of the Sequential activity fails in an ADF pipeline.

Documentation: https://learn.microsoft.com/en-us/azure/data-factory/tutorial-pipeline-failure-error-handling

Overview

This request provides a step-by-step by explanation to get the error details if any of the sequential activities fails.

When we try to get the error details with an expression like activity('<activity_name>').Error.Message of the any activity when the activities are in sequential, we will get the below error.

The expression for <activity_name>  cannot be evaluated because property 'Error' cannot be selected.

Correction Details:

This guide will allow users to:

Handle the above error and will help to get the activity error details.

Steps:

  1. Prerequisites:

    Create minimum two pipeline activities (In this case both activities are Execute pipeline activities) and both should execute in a sequential manner.

  2. Reason for the above error:

    The reason for this error is, when the first activity itself is a failure, the pipeline flow will not execute the second activity. Here, we are using the above expression to get the second activity error as well but in this case, it didn't executed so there will be np error details for this activity.

  3. Steps to avoid this error:

    Modify the pipeline flow like below.

    Use the below pipeline expression to get the error details.

    @concat(if(not(equals(coalesce(activity('Execute Pipeline1').Error),null)),
       activity('Execute Pipeline1').Error.Message,''),'',if(and(not(equals(coalesce(activity('Execute 
    Pipeline2')),null)),not(equals(coalesce(activity('Execute Pipeline2').Error),null))),
       activity('Execute Pipeline2').Error.Message,''))

Conclusion

By following this guide, users can avoid the above error and can get the error details of the any activity sequential activity.

Reference:

https://stackoverflow.com/questions/79190722/how-to-save-error-details-in-set-variable-activity-if-any-sequential-activity-fa/79191139#79191139

This Correction request aims to improve user experience and security by providing clear documentation and example scripts to get the error details of a sequential activity in an ADF pipeline.


ms.author: @makromer ms.reviewer: @jburchel

TPavanBalaji commented 3 days ago

@GovindulaRakesh Thanks for your feedback! We will investigate and update as appropriate.