Configuring project for Azure Pipelines
This page explains project-level settings required if you use Azure Pipelines for your project analysis.
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 Cloud as a service connection in your Azure DevOps project.
Proceed as follows:
In SonarQube Cloud, create an authentication token that will be used by Azure DevOps to execute the analysis of your project in SonarQube Cloud. To do so, create a Scoped Organization Token (recommended from the Team plan) or a personal access token, and copy it. For more information about tokens, see Managing personal access tokens and Scoped Organization Tokens.
In your Azure DevOps project, go to Project Settings > Service connections.
Select New service connection and then select SonarQube Cloud from the service connection list.

Set the parameters:
In Region (optional) field: If you use the SonarQube Cloud’s US instance, select US. Otherwise, make sure Global is selected (default value).
In SonarQube Cloud Token, enter the token created in the first step.
In Service Connection Name, enter a memorable name (You will need this name when configuring your Azure build pipelines).
In the example below, the US instance is used.

Select Verify to verify the connection to the SonarQube Cloud's instance.
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 on the Configuring Azure DevOps project binding page.
If your code is stored on GitHub or Bitbucket Cloud, open the expandable content below.
Related pages
Related online courses
Last updated
Was this helpful?

