Even though YAML pipelines could be setup to wait for approvals based on environment approvals and checks, setting up a manual intervention task which was available to classic release pipelines, was not supported in YAML deployment pipelines till the latest feature release to Azure DevOps. With the introduction of new Manual Validation Task specifically supporting only YAML pipelines, now you can wait for resume/reject with an agentless job, during the YAML pipeline execution. Let’s look at how this new task works.
The task in action would look like as shown below. The manual validation here waits for confirmation on the correct release number is applied or not, based on the utilized build in the deployment, which might help preventing accidentally, deploying package with a wrong build as input to the deployment pipeline setup in YAML.
Once click on review you can decide to resume or reject the pipeline based on manual validations performed.
The code is setup for this one pipeline as below. Manual validation task is set to run only when the release number setup job is completed, using a depends on, to ensure the notification for manual validation only sent after the release number is set. The time out of the manual validation agent less job should be higher than the manual validation task to run completely. The agentless job is set by setting the pool to server. Once the validation task timeout hit the default action would be to reject. You can set it to resume automatically by setting up onTimout option as resume.
Following is the job code of the manual validation task.
Following is the entire pipeline code.
You can search for this new manual validation task in Azure DevOps web UI while editing a pipeline as shown below.
Then can fill the details and get it added to pipeline.
If you are using the manual validation task and if the pipeline stage has more than one job to perform, make sure to set the dependencies correctly. Else for example if the release number job is not set as a dependency in the case scenario in this blog, the manual validation notification is sent before even setting the release number.
No comments:
Post a Comment