Azure Devops Condition in a YAML Pipeline - only run between specific time

24 Views Asked by At

In UX created Azure Pipelines, it was easy to set a Schedule for when each step should run in a release pipeline.

Depicts the classic ADO pipeline experience for pre-deployment conditions, specifically highlighting the scheduling ux

I'm trying to do this in a yaml based pipeline and not understanding how to do it.

Specifically, I want each step in the pipeline for my release to wait until weekdays, at noon est, which corresponds to this cron definition 0 12 * * 1-5

I'm wondering if it's possible to run each step in my pipeline on a schedule. The effective goal is that each step runs on the next weekday, but I can skip ahead if needed for an express deployment.

1

There are 1 best solutions below

0
FoxDeploy On

I found the answer! As of March 2024, I could not find where to do this in YAML because you do not do this in YAML. Instead, the flow is that as an Administrator, you use the Web UI to create Approvals and Checks, and one of the out of the box checks in Business Hours

Approvals and other checks aren't defined in the yaml file. Users modifying the pipeline yaml file can't modify the checks performed before start of a stage. Administrators of resources manage checks using the web interface of Azure Pipelines. Source

You can define them in the UX.

If you already have a YAML Release pipeline, navigate to that:

enter image description here

Click on Environment:

enter image description here

From here, you can click the three dots, then select Approvals and Checks to add and configure your buiness hours. enter image description here