locked
Parse the Error Json message on Azure Data Factory and pass it to another activity as input. RRS feed

  • Question

  • Dear Developer,

    I'm dealing with errors in ADF. I wanted to ask if it's there any way of getting the value of the error message of one lookup activity in order to pass this value as an input parameter of another activity.

    I've tried something like @activity('lookup1').Error.message but it does work.


    Thanks in advance

    Thursday, April 18, 2019 12:38 PM

All replies

  • Hello Arundil and thank you for your question.  You were very close to getting it right.  Here is what I did:

    In a setVariable activity connected to the Lookup activity by a red 'on failure' line I used:

    @{activity('Lookup1').Error.Message}

    The curly braces { } coerce to a string.

    Friday, April 19, 2019 12:20 AM
  • Going back, I tested case sensitivity.  Here is what I found:
    Both "...Error.message" and "...Error.Message" worked fine.

    However the "@activity('lookup')..." versus "@activity('Lookup1')..." did break.  The activity name IS case sensitive.

    I also tested with and without the curly braces {}.  The curly braces make no different for String variable.
    Friday, April 19, 2019 12:23 AM
  • Hi MartinJaffer,

    Thanks for your quick answer... but @{activity('Lookup1').Error.Message} it is not working for me

    I'm using as you told me: @{activity('Lookup1').Error.Message} but it seems the property error it's not found...

    activity('Lookup1').Error.Message' cannot be evaluated because property 'Error' cannot be selected."

    I triggered a Set Variable activity using the red path after the failure of Lookup1 activity getting the message above.




    • Edited by Arundil Friday, April 19, 2019 7:38 AM
    Friday, April 19, 2019 7:32 AM
  • Hmm.  Could you show me what you get with "@activity('Lookup1')" on both succeed and on fail?  This is Data Factory V2, right?
    Friday, April 19, 2019 7:12 PM
  • Hi,

    Yes, I'm using ADF V2. I was playing around a little bit and I found the following thing:

    If I create a complete blank pipeline and I just put a Lookup activity and a "Set Variable" activity. In this case, it is working as you can see in the following screenshot: 

    Working case

    But if you try to fetch the error in a complex pipeline, then I can see that it is not working:


    And you get this error:

    Maybe I'm doing something wrong, but for my perspective it should be possible to fetch this error message here as well, right? 

    Monday, April 29, 2019 2:40 PM
  • I agree, it should be possible.  I have no insight at this time as to what is different.
    Tuesday, May 7, 2019 9:25 PM
  • Hi,

    I have the same scenario, where there is a complex chain of activities and need to have the error message logged back to a storage when something is broken.

    I am also seeing the same behaviour where you cannot reference .Error.Message from the failed activity inside the pipeline.

    According to this post https://docs.microsoft.com/en-us/azure/data-factory/transform-data-using-stored-procedure

    And the closed issue discussions : https://github.com/MicrosoftDocs/azure-docs/issues/18481

    This extraction of error log information is not allowed inside the pipeline, is by design?  Or maybe it brakes something else?  As the docs clearly have referenced this at one point in time.

     And as a workaround we need to go to the Azure monitor, another paid subscription service to be setup and monitor / add alerting there.

    I would really hope for Microsoft to be more development friendly and allow the developers building these ADF solutions to handle the message in any way fits the projects.

    Also this way of doing things no longer works

    https://www.mssqltips.com/sqlservertip/5962/send-notifications-from-an-azure-data-factory-pipeline--part-2/



    • Edited by JuryNevada4 Thursday, October 3, 2019 8:38 PM
    Thursday, October 3, 2019 8:33 PM
  • Any way to have a feature request to re-instate the capability of reading the Error json from failed activities?

    Is there a place to file this request? Or add more users to the support of this feature?

    Friday, October 4, 2019 5:49 PM
  • Yes there is a place you can make feature requests.  The Feedback Forum for Data Factory is located at:

    https://feedback.azure.com/forums/270578-azure-data-factory

    Friday, October 4, 2019 6:45 PM