0

In my YAML script I have several environments I deploy to with manual triggers. I tend to deploy to my production environment at various times. In the classic release I was able to ad hoc schedule the release but in YAML I have not figured it out. Does anyone have any experience in this?

  • Are you looking for something like [this](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/scheduled-triggers)? – Lucas Bazetto Aug 25 '21 at 17:10
  • @LucasBazetto nope. CRON scheduling can only be defined in the yaml file and you can't use any pipeline variables to override. I am looking to set something ad hoc i.e I randomly want to schedule a release at 10pm one day and 11pm another day. – iEnjoyFreeBacon Aug 25 '21 at 17:13

2 Answers2

1

Azure Devops ad hoc schedule YAML releases

There is a same setting for the YAML pipeline.

Click more actions and select the Triggers in the pipeline:

enter image description here

Then add the Scheduled:

enter image description here

Note: Since manual stages in yaml pipeline is not available currently, so there is option to set the schedule for each stage in YAML pipeline.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • this might work. I could create a separate pipeline just for my production deployment then just release of a release branch...Thanks! – iEnjoyFreeBacon Aug 26 '21 at 16:51
0

There is a workaround for this.

Leverage the Environments features in Multi-Stage YAML pipelines w/ an approval gate.

This will allow the pipeline to run through the stages until it hits an environment requiring an approval, ideally the first job in the stage. Which can just sit or be approved.

This would look like:

  - deployment: deploy${{ parameters.environmentName }}
    displayName: "Deploy ${{ parameters.environmentName }}"
    variables:
    environment: ${{ parameters.environmentName }}

And the enviornmnet would have an approval: enter image description here

And the stage would wait until an approval: enter image description here

DreadedFrost
  • 2,602
  • 1
  • 11
  • 29