pipeline status shows succeeded if the last activity failed.

Ramalingam, Balamurugan 21 Reputation points
2020-10-20T14:57:20.937+00:00

my pipeline contains below activity
33660-image.png

if my last Stored procedure failed (marked), my pipeline status show succeeded instead failed.

I added another dummy activity after that last stored procedure (after the success), then it says failed.

Is that bug ?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,568 questions
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 26,081 Reputation points
    2020-10-20T17:39:28.53+00:00

    Hello @Ramalingam, Balamurugan and welcome to Microsoft Q&A.

    The success / failure status of a pipeline is not intuitive. Please allow me to explain in more detail.

    The pipeline will report fail when either:

    • The very last activity run reports failure
    • There is a success path (dependency), and that path is not taken.

    In the picture you shared, the very last activity run reports success. Also, the failing activity has an on-failure output, and no on-success output. The pipeline should report success.

    If you want the pipeline to report failure instead of success when this happens, add a dummy activity (like a wait activity) as on-success output of the failing activity "CallingLoadingStoredProc". This will fulfill the second condition I mentioned.

    The solution provided by @John Aherne is a good alternative, because it separates expected failures from unexpected failures. To clarify, in your pipeline you handle expected errors in "StagingTableLoad" and "CallingLoadingStoredProc". What if "UpdateProcessControlWithStageCompletion" or "CheckBatchId" had an error? John's proposal lets you easily know the difference.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. John Aherne 516 Reputation points
    2020-10-20T16:29:42.537+00:00

    It's because you have a Fail path.

    I got around this by having a stored procedure also raise an error (e.g. Your InsertLoadingError SP should log the error and then raise an error at the end of the SP).

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.