I have an ADF pipeline with a for each loop on files and performing some activity that should only run for the downtime hours. I am starting it using a trigger and want it to gracefully exit execution after 2 hours, whether it is done looping through all files or not.
Is there a way to configure it in ADF?
I found a way - I used 2 variable at start of the main pipeline :
Flow is like this:
1.Set the original time variable as start time of pipeline using utcnow() 2.Set add time using addtime() to last time value till it can execute 3.Set the boolean variable 'state' to true or false comparing if starttime is less than addtime
4.For loop--> 1st run ( If activity to check 'state' variable ( True- execute the flow False-do nothing ) -->set the original time variable again -->compare with last time and set state to updated value ) 2nd run .... 3rd run..
when 'state' is false If will run till for each values are exhausted doing nothing.