ADF - Getting the error message of a previous activity

Kothai Ramanathan 946 Reputation points Microsoft Employee
2020-12-21T10:36:31.453+00:00

I have a pipeline with activities like this.
49977-image.png

When the copy activity fails, I want to use the error message of the copy activity, and set it in the error variable. How do I get the error message of the copy activity - in the set variable activity for the error message.

Any pointers will be helpful, thanks

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

8 answers

Sort by: Most helpful
  1. Vaibhav Chaudhari 38,916 Reputation points Volunteer Moderator
    2020-12-21T10:59:21.617+00:00

    Try to set below in set variable dynamic expression

    @activity('Copy to destination').output.errors[0].Message


    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

    5 people found this answer helpful.

  2. Ryan Abbey 1,186 Reputation points
    2021-07-12T00:32:11.753+00:00
    @activity('Copy to destination').error?.message
    

    You will get a failure when there is no "error" output so the "?" says to set if it exists

    5 people found this answer helpful.
    0 comments No comments

  3. Vinodh247 34,661 Reputation points MVP Volunteer Moderator
    2022-10-03T06:13:31.977+00:00

    Below is the correct pipeline expression that has to be provided to track the error message. The expressions that are provided in the above answers are wrong and doesn't work.

    @activity('Execute Pipeline1').error.Message

    3 people found this answer helpful.
    0 comments No comments

  4. Diponkar Paul 1 Reputation point
    2021-02-04T15:49:40.35+00:00

    Hi Vaibhav,
    I tried your answer but I get this error. My code is: @activity('DF_AAAAA').Output.errors[0].Message and passing this to store procedure. Please note that, my previous activity is data flow.

    64066-image.png


  5. Nasreen Akter 10,811 Reputation points Volunteer Moderator
    2021-02-04T16:55:01.657+00:00

    Hi @Diponkar Paul & @Kothai Ramanathan ,

    Please try the following:

    • to get the error message from DataFlow Activity: @activity('DataFlow').error.Message
    • to get the error message from CopyActivity: @activity('CopyData').output.errors[0].Message

    Thanks!


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.