We are using
- Developer Edition
- Version 8.3.1 (build 34397)
We are moving our pipelines from Jenkins to Azure, Currently in Jenkins our pipelines correctly fail if the SonarQuality gate is not passed.
We are having problems replicate this in Azure
Our yaml looks like
- task: SonarQubePrepare@4
inputs:
SonarQube: 'Devlopment-Sonarqube'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: ${{ parameters.sonarProjectKey }}
cliProjectName: ${{ parameters.sonarProjectName }}
cliSources: 'app'
- task: SonarQubeAnalyze@4
- task: SonarQubePublish@4
inputs:
pollingTimeoutSec: '300'
This works in the sense that we can see the see the code has been scanned and correctly failed in Sonar itself. But we want the pipeline to end at this point if it fails
I’ve seen others have had this problem, and have resulted in calling the rest API. Is this still the best method? E.g Something like