Setting up project integration
SonarQube Server project-level settings required for Azure DevOps or Azure Pipelines for your project analysis.
Setting up pull request integration with Azure DevOps
SonarQube Server can:
Report the quality gate status and analysis metrics to your pull requests in Azure DevOps.
Show issues detected on a pull request in Azure DevOps. Each issue will be a comment on the Azure DevOps pull request. If you change the status of an issue in SonarQube Server, that status change is immediately reflected in the Azure DevOps interface.
To set up the pull request analysis:
Check the Prerequisites for setting up a pull request analysis.
Enable the pull request analysis on the target branch; open the Enabling pull request analysis on target branch collapsible below for details.
If you don't use an integrated CI tool like Azure Pipelines, you must set up the pull request parameters manually; check the Setting up the pull request parameters article for details.
For an unbound project, an additional setup is required; open the Additional setup for an unbound project collapsible below for instructions.
You can prevent the pull request merge if the quality gate fails; open the Preventing pull request merges when the quality gate fails collapsible below for more information.
Setting up integration with Azure Pipelines
If you use Azure Pipelines, you must configure a service connection in Azure and enable the pull request analysis in your pipeline.
Adding SonarQube service connection to Azure Pipelines (SonarQube endpoint)
Service connections are authenticated connections between Azure Pipelines and external or remote services. You must declare your SonarQube Server as a service connection in your Azure DevOps project.
Proceed as follows:
1. In SonarQube, create an authentication token that will be used by Azure DevOps to execute the analysis of your project in SonarQube. To do so, create a token and copy it. For more information, see Managing your tokens.
2. In your Azure DevOps project, go to Project Settings > Service connections.
3. Select New service connection and then select SonarQube Server from the service connection list.

4. Enter your SonarQube Server URL, the token created in the first step, and a memorable Service connection name (You will need this name when configuring your Azure build pipelines). Then, select Save to save your connection.

Enabling the pull request analysis in your build pipeline
The Azure DevOps extension running in your Azure pipeline can automatically detect branches or pull requests being built (you don’t need to pass them as parameters to the scanner).
To enable the pull request analysis in your Azure pipeline of code stored on Azure DevOps, you must configure a pull request trigger on the target branch (main development branch) as explained above in Enabling pull request analysis on target branch. If your code is stored on GitHub or Bitbucket Cloud, see below.
Disable pull request annotations
Using the default setup, SonarQube Server will add annotations on issues it detects in your Azure DevOps pull request (PR). It’s possible to completely remove the PR integration with Azure DevOps to remove these, but that’s not ideal if you want to keep reporting the quality gate status and analysis metrics to your PRs. To disable annotations from SonarQube Server on your Azure DevOps PRs:
First check if your Azure organization has already been integrated with SonarQube Server. See the Setting up integration at global level page.
Next, retrieve your project and navigate to Project Settings > General Settings > DevOps Platform Integration.
Complete all of the required fields and deselect Enable Inline Pull Request Annotations.
Select Save to finish and if successful, you will see confirmation and configuration validation notifications.
Related pages
Last updated
Was this helpful?

