How to fail pipeline when SonarCloudAnalyze has an error on Azure DevOps

Thanks for sharing more details and for your honest feedback.

Regarding your comment:

(e.g. it’s also not possible to enforce quality across whole code base and not only on changed code).

You can add Quality Gate conditions on Overall code for long-lived branches. You can do this by updating your organisation’s Quality Gate or creating a custom one with your own conditions.

Here’s a screenshot: