Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manual approvals for stages in Azure Devops pipelines (YAML)

I have a stage that uses 6 deployment jobs that can either deploy to dev, staging or production depending on specific conditions.

For deploying to production, I'd like to add manual approvals. I am aware that deployment jobs can specify environments on which you can add manual approvals, but I'd like to approve the entire stage and not each individual deployment job. This way, I can approve the stage once and all 6 deployment jobs can run at once, instead of having to approve 6 times.

Is this possible? The documentation says it should be, but it doesn't say how. Besides, in the YAML schema for stages, it doesn't look like you can specify environments inside stages.

like image 515
a3y3 Avatar asked Jan 29 '26 10:01

a3y3


1 Answers

Looks like the ManualValidation task could help you there. Using dependsOn will allow all other jobs to complete before final approval.

Example:

jobs:  
  - job: waitForValidation
    dependsOn: 'previousJobName'
    displayName: Wait for external validation  
    pool: server    
    timeoutInMinutes: 4320 # job times out in 3 days
    steps:   
    - task: ManualValidation@0
      timeoutInMinutes: 1440 # task times out in 1 day
      inputs:
        notifyUsers: |
          [email protected]
          [email protected]
        instructions: 'Please validate the build configuration and resume'
        onTimeout: 'reject'
like image 53
Ian Avatar answered Feb 01 '26 02:02

Ian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!