How to fail Azure pipeline when quality gate fails

Hi everyone, I created a custom quality gate in SonarCloud. It works fine. But even if it fails, pipeline keeps working. How can I fix this?

Hey there.

Some users want the build to fail when the QG fails, others absolutely don’t.

Checkout the sonar.qualitygate.wait analysis parameter.

Thank you! Fixed now.

How can I set it in Maven projects?

mvn sonar:sonar -Dsonar.qualitygate.wait=true

Or adding the property in your pom.xml.