you could either set-up a mandatory environment approval or add an additional stage with an ManualValidation@0
task like so:
- stage: approval
displayName: 'Approval'
dependsOn: ci
jobs:
- deployment: approval
displayName: Approve
timeoutInMinutes: 4320 # job times out in 3 days
pool: server # note: the value 'server' is a reserved keyword which indicates this is an agentless job
environment:
name: ProdSA
resourceType: VirtualMachine
strategy:
runOnce:
deploy:
steps:
- task: ManualValidation@0
inputs:
instructions: 'Approval required'
timeoutInMinutes: 1440 # task times out in 1 day
result
note 1: the task will not work if you do not specify the pool: server
, so I was not able to include the task inside of the actual dependent stage that executes on the remote agent. So in the setup like mine, you will need a separate stage for the approval.
note 2: you need the ManualValidation@0
specifically, not the ManualIntervention@8
task. I have been getting weird errors with the later
note 3: don't forget to set dependsOn: approval
for the stages that follow next after approval stage.