Azure DevOps > Branch Policies > Status Check > "SonarQube/Quality Gate"

I am encountering difficulties in integrating Pull Request (PR) annotation within Azure DevOps environment. Despite required configuration, the “SonarQube/Quality Gate” status check is not appearing as expected after triggering the pipeline on a pull request.

Here’s a summary of the steps we have taken:

  1. General Integration:
    We have successfully established the general integration between Azure DevOps and SonarQube, with SonarQube added to the service connections in Azure DevOps.
  2. Pipeline Configuration:
    • We have incorporated the necessary SonarTasks (SonarQubePrepare@6, SonarQubeAnalyze@6, SonarQubePublish@6) into our pipeline.
    • The pipeline trigger is set to “pr”.
    • The pipeline has been added to the “Branch Policies > Build Validation” section.

Even after executing the pipeline (with the PR trigger) upon raising a pull request, the anticipated “SonarQube/Quality Gate” status check remains absent.

Hey there.

What version and edition of SonarQube are you using?

  • Enterprise Edition
  • v10.5.1

Thanks!

I would first suggest that you make sure you have configured each project with the settings found under the project-level Project Settings > DevOps Platform Integration. This is required for PR decoration to take place.

Yes the Project Settings > DevOps Platform Integration is configured correctly.
Currently I added the sonar tasks as a build validation pipeline that add comments in the PR as the quality gate fails. I kinda works the same. If the recommended way of “SonarQube/Quality Gate” in status check provides additional benefits I would like to go with that solution instead.