If activity alternatives

Mohamed Ahmed (Jimmy) 20 Reputation points Microsoft Employee
2023-05-03T09:53:22.4+00:00

I am looking to implement some sort of branching if condition instead of using the If condition activity block.

Reasons for this are, at some point in my pipeline there needs to be 2 different flows depending on a certain Boolean, what I did was use an If condition activity block, the problem with it is that when the pipeline fails, and I rerun it from the failed activity, the whole if block reruns, which will waste a lot of time. So I need to implement a branching If condition that is not nested within another activity, I am thinking of using this DO-IF-SKIP-ELSE approach mentioned here.

Is this a good approach? And are there any other approaches I am missing?

Thanks,

Mohamed Ahmed

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

Accepted answer
  1. Sedat SALMAN 13,265 Reputation points
    2023-05-03T20:59:55.7366667+00:00

    The DO-IF-SKIP-ELSE approach you mentioned is one possible solution, especially if you're looking to avoid nested If conditions. However, this approach can become cumbersome if you have a lot of branches or complex conditions. Another approach you might consider is using the Switch activity in Azure Data Factory. The Switch activity can help you branch your pipeline based on the value of an expression. This way, you can define multiple cases, and the Switch activity will execute only the matching case. If you have more complex conditions or multiple branches, this could be a more suitable option for your use case.

    0 comments No comments

0 additional answers

Sort by: Most helpful