locked
How to Force Failure in ADF Pipeline using set variable activity or validation activity RRS feed

  • Question

  • Hi - I am facing a challenge on how to enforce failure on my ADF pipeline using the validation activity or set variable pipeline. I could not use the IF Condition as I have several IF Condition activities after the force failures - and we couldn't add If Conditions inside the If Conditions. Here's my concern, I am logging a processed data in a table using Copy Data Activity (i am truncating and copying the data that meets the criteria of the PercentageDataLoaded which is < 95% or > 105%) - this criteria means that it didn't pass the data quality check so the pipeline should fail. Can anyone please help me. Thanks

    Thursday, March 19, 2020 4:19 AM

Answers

  • To force an error in a pipeline I usually use a Stored Proc activity and raise an error there, as has been suggested.  But I'd also like to add, if you have a need to have nested IF statements, you can work around this by nesting separate pipelines and using Execute Pipeline activities, creating a Master/Child relationship.  I've had to do this many times when trying to nest Until activities,ForEach,If Statements, etc.  Hope this suggestion helps.
    Thursday, March 19, 2020 2:17 PM

All replies

  • Hi there,

    Please vote for this feedback.

    There are several workarounds such as a Web Activity to throw an error by trying to connect to https://ThrowAnError or a Stored Procedure activity which executes a raiserror function in Azure SQL Database. 

    Hope this helps.

    Ref - https://stackoverflow.com/a/59349606/10653466
    Thursday, March 19, 2020 6:05 AM
  • To force an error in a pipeline I usually use a Stored Proc activity and raise an error there, as has been suggested.  But I'd also like to add, if you have a need to have nested IF statements, you can work around this by nesting separate pipelines and using Execute Pipeline activities, creating a Master/Child relationship.  I've had to do this many times when trying to nest Until activities,ForEach,If Statements, etc.  Hope this suggestion helps.
    Thursday, March 19, 2020 2:17 PM
  • Thanks for sharing your inputs. Hope you are unblocked now.
    Friday, March 20, 2020 8:28 AM