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?

>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:

- stage: StageToFail
  - job: JobToFail
    - pwsh: throw "Throwing error for debugging purposes"

Leave a ReplyCancel reply