This post has been republished via RSS; it originally appeared at: Microsoft Tech Community - Latest Blogs - .
Series Overview
Orchestration allows conditional logic and enables users to take different paths based upon outcomes of a previous activity. Building upon the concepts of conditional paths, ADF and Synapse Pipelines allows users to build versatile and resilient work flows that can handle unexpected errors that work smoothly in auto-pilot mode.
This is an ongoing series that gradually levels up and helps you build even more complicated logic to handle more scenarios. We will walk through examples for some common use cases, and help you to build functional and useful work flows.
Please review the first installment in the series: Pipeline Logic 1: Error Handling and Best Effort Step.
#1 Shared error handling logging step
It is often the case that you would have a shared error handling/logging step in your workflow. This will be invoked if any of previous activities failed. You can build your pipeline like this:
- Run multiple activities in parallel
- Add an If condition to contain the error handling steps, in a True branch
- Connect activities to the condition activity using an Upon Completion path
- Logical expression for condition activity reads
Note: You'll need concatenated or if you have more than two dependency activities, for instance:(equals(activity('ActivityFailed').Status, 'Failed'), equals(activity('ActivitySucceeded').Status, 'Failed'))
(or(equals(activity('ActivityFailed').Status, 'Failed'), equals(activity('ActivitySucceeded1').Status, 'Failed')),equals(activity('ActivitySucceeded1').Status, 'Failed'))
#2 Greenlight if any activity succeeded
- Run multiple activities in parallel
- Add an If condition to contain the error handling steps, in a True branch
- Connect activities to the condition activity using Upon Completion path
- Logical expression for condition activity reads:
(equals(activity('ActivityFailed').Status, 'Succeeded'), equals(activity('ActivitySucceeded').Status, 'Succeeded'))
Note: The graph will look exactly like the previous scenario. The only difference is the expression language used.
#3 All activities need to succeed to proceed
This pattern combines the best of the two: conditional and + error handling. The pipeline proceeds to next steps if all proceeding activities succeed, or else it runs a shared error logging step. You can build your pipeline like this:
- Run multiple activities in parallel
- Add an If condition. Add next steps in a True branch, and add error handling code in a False branch
- Connect activities to the condition activity using Upon Completion path
- Logical expression for condition activity reads:
@and(equals(activity('ActivityFailed').Status, 'Succeeded'), equals(activity('ActivitySucceeded').Status, 'Succeeded'))
We hope that you have found this blog to be helpful! If you have any questions or feedback, please post them in the comments below.