Avoidance of Infinite Iterations of Until activity within Azure Data Factory / Synapse Pipelines

Problem Statement :

In case if there is a failure of any activity inside an Until activity and the termination condition is not being met, the Until activity would go under infinite executions.

So how to avoid infinite executions in case of some error or exception scenarios.

Pre set up :

Infinite Iterations in case of Failures:

And one has to manually cancel the executions to avoid the infinite iterations.

Prerequisites :

  1. Azure Data Factory / Synapse Pipeline

Solution :

  1. In my previous blog of Error Logging and the art of avoiding redundant activities, we saw how to assign the failure messages of all activities within a single variable ; we would need to follow the same steps within the until activity.

Create a variable : ErrorHandling and follow the proper process to set up that variable value

New Flow :

2. Within the Until activity expression , in addition to the existing expression Add an OR aspect with the below expression

not(equals(variables('ErrorHandling'),''))

The above expression would map to TRUE in case if there is any value present within the ErrorHandling variable which in turn would state that there was a failure in one of the activity because of which a failure message got inscribed within the ErrorHandling variable.

3. Once the ErrorHandling variable maps to TRUE and irrespective of any other conditions being met or not, the OR statement would ensure that the Until loop is exited thereby avoiding infinite executions.

The JSON for the above Error handling framework is available at this GitHub location.

Note: The variable DummyFailure is to induce error in the Pipeline for testing purpose. For a Success scenario, update the type of the DummyFailure variable from Array to String.

Published by Nandan Hegde

Microsoft Data MVP |Microsoft Data platform Architect | Blogger | MSFT Community Champion I am a MSFT Data Platform MVP and Business Intelligence and Data Warehouse professional working within the Microsoft data platform eco-system which includes Azure Synapse Analytics ,Azure Data Factory ,Azure SQL Database and Power BI. To help people keep up with this ever-changing landscape, I frequently posts on LinkedIn, Twitter and to his blog on https://datasharkx.wordpress.com. LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66 GitHUB Profile : https://github.com/NandanHegde15 Twitter Profile : @nandan_hegde15 MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942

Leave a comment

Design a site like this with WordPress.com
Get started