How to fail the Azure pipeline if any errors are reported in the task

Viewed 66

Pipeline is not failing even though the application errors are reported in one of the task. For that i have used failonstderr: true in the pipeline and pipeline detects the errors and start failing. But the problem is failing the pipeline for warnings also. But i am looking for the pipeline should fail when errors are reportedenter image description here not on warnings. Is there any alternate solution?

1 Answers

You could set the control option of each task by disable Continue on error and Run this task Only when all previous tasks have succeeded. Then, any errors are reported in the task, pipeline will failed. Please refer to Task control options for more information.

enter image description here

As for YAML pipeline, please make sure you have add continueOnError: false to you task. Besides, make sure you haven't add condition: expression to each task. Then, it default to Only when all previous task have succeeded.

Related