Azure

Guide on Implementing ContinueOnError in Azure DevOps for Task Failures

Introduction

At times, you might encounter Pipeline Tasks relying on third-party APIs that are beyond your control. When such Tasks fail due to issues with the third-party APIs, it can lead to the failure of your entire pipeline. The uncertainty of when the issue will be resolved adds to the challenge. However, the invocation of the third-party API may not be crucial for your upcoming release.

Solution

In situations like this, it is beneficial to allow the execution of subsequent Tasks to proceed. This article explains how to enable the continuation of a pipeline’s execution even if a specific Task fails, using the ContinueOnError property.

Let’s create a pipeline with multiple tasks and intentionally introduce an error in one task, as demonstrated in the example below.

From the screenshot above, observe the following:

  • The task named “Not So Important Task” contains an intentional typo (using “Write-Hosts” instead of “Write-Host”) to simulate an error.
  • An attribute called continueOnError has been incorporated to overlook errors during the pipeline execution.

Upon running the pipeline, you will receive an error indication for the Task, and the execution will progress as illustrated below.

Jobs in run

Summary

This blog post has elucidated how to allow the pipeline’s execution to continue despite errors in specific tasks. This straightforward technique is useful in scenarios where a non-essential task encounters intermittent failures, and you wish to proceed with the pipeline execution.

If you have any queries, please feel free to comment below. Thank you for reading.

To know more about Skrots and our services, visit us at Skrots. Explore a wide range of services we offer at Skrots Services. Don’t forget to check out our other blogs at Blog at Skrots

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button