sr123
sr123

Reputation: 29

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

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?

Upvotes: 2

Views: 7759

Answers (1)

Suki Ji-MSFT
Suki Ji-MSFT

Reputation: 753

Classic Pipelines

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

enter image description here

YAML pipelines

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

Upvotes: 2

Related Questions