Skip to content
Latchkey

How to Gate Prod With a Manual Validation in Azure Pipelines

ManualValidation@0 in an agentless job pauses the pipeline and waits for a named user to approve or reject.

Add a server (agentless) job before the deploy with ManualValidation@0. The run pauses, notifies the listed users, and resumes only on approval.

Steps

  • Add a stage with pool: server (agentless) before the deploy.
  • Use ManualValidation@0 with notifyUsers and an instructions message.
  • Make the deploy stage dependsOn the validation stage.

azure-pipelines.yml

azure-pipelines.yml
stages:
  - stage: Approve
    jobs:
      - job: WaitForApproval
        pool: server
        steps:
          - task: ManualValidation@0
            timeoutInMinutes: 1440
            inputs:
              notifyUsers: 'release@example.com'
              instructions: 'Approve to deploy to production.'
              onTimeout: 'reject'
  - stage: DeployProd
    dependsOn: Approve
    jobs:
      - deployment: Prod
        environment: production
        strategy: { runOnce: { deploy: { steps: [ { script: ./deploy.sh prod } ] } } }

Gotchas

  • ManualValidation only runs in an agentless (pool: server) job, not a normal job.
  • Set timeoutInMinutes and onTimeout so a forgotten approval does not hang the run forever.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →