Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the easiest way to make Azure pipeline stage fail for debugging purposes

I would like to make a given stage fail to test my conditions

- stage: EnvironmentDeploy
  condition: and(succeeded()...)

is it possible to make - stage to fail purposefully?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The easiest way I can think of is adding a job with a PowerShell script, and using the throw keyword to exit the script with an error:

stages:
- stage: StageToFail
  jobs:
  - job: JobToFail
    steps:
    - pwsh: throw "Throwing error for debugging purposes"
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading