I need to schedule an Azure data factory pipeline that runs every 10th business day of the month. Saturday & Sunday are not business days. for example, if we exclude Sat & Sun, then 10th Business day for Jun 2023 falls on 14th June. The next 10th business day falls on 28th and so on. So the ADF pipeline should run on those dates.
Tried tumbling window trigger, but not sure how to achieve it.
2
Answers
You cannot achieve this with regular ADF triggers.
You can trigger the pipeline on a few month days, i.e. 10,11,12,13,14 , and run some code to check if today is a business day. You will also need to check on the following days that your process hasn’t already run, by using some config table or file.
You can do the following steps to achieve the requirement. Triggers might not help you to achieve your requirement. I have used pipeline activities to determine the business days which are multiples of 10 in a month. The following are the steps that I have used.
First get the start date of a particular month. Use an until loop which iterates until the last day of the month.
In until activity, I have used a combination of variable activities to get all the dates in that month.
Now use a filter activity to filter out the days where its Sunday or Saturday.
Finally, select the business days that are multiple of n (where n=10 for example).
The following is the complete pipeline JSON for the above: