Using various features
This page explains numerous features you may use when adding a SonarQube Cloud analysis to your Azure build pipeline.
This page explains features you may use when adding SonarQube analysis to your Azure build pipeline:
Choosing the analysis configuration mode (only in the Standalone SonarScanner CLI mode).
Using a specific version of the SonarScanner for .NET or CLI
Using the cache feature
Choosing the configuration mode
In the CLI mode of the Azure DevOps extension for SonarQube Server, you may:
Either use the file configuration mode (default mode) which consists of setting analysis parameters in the
sonar-project.properties
file stored in the repository root (or another specified configuration file).Or use the manual configuration mode to define analysis parameters at the pipeline level.
Using a specific version of SonarScanner for .NET or CLI
The Azure DevOps extension for SonarQube Cloud embeds the latest compatible version of the SonarScanner for .NET and SonarScanner CLI. In very particular situations, you may want to use another scanner version. In such a case, you can configure the download of this specific version from the SonarSource binaries site. In addition, you can use the Azure cache task (see below) in your pipeline to manage the caching of the SonarScanner.
The figure below shows the download process of a specific version of SonarScanner for .NET or SonarScanner CLI.

Set up the download in the Prepare Analysis Configuration task of your pipeline as described below.
Using the cache feature
Azure DevOps allows pipeline caching to improve build performance by facilitating the download of dependencies between pipeline runs. Currently, you can only cache the SonarScanner (bootstrapper) that is downloaded when you need a specific version of SonarScanner for .NET or CLI.
Proceed as follows:
Add a cache task to your Azure build pipeline before SonarQube’s Prepare Analysis Configuration task. See the code snippet below according to the extension mode.
Adding the quality gate status widget to your project
You can monitor the quality gate status of your projects directly in your Azure DevOps dashboard. Follow these steps to configure your widget:
Once the Azure DevOps extension is installed and your project has been successfully analyzed, go to one of your Azure DevOps dashboards (or create a new dashboard). Click on the Pen icon to edit, and then select Add Widget.
In the Add Widget list, select Code Quality, and then select Add. An empty Configure widget is added to your dashboard.
Select the widget’s Cogwheel icon to configure it.
For public projects, you can simply select your project from the dropdown. A search bar inside the drop-down will help you find it easily. Just select it and Save.
For private projects, log in using the links provided under the drop-down. Once logged in, your private projects will appear in the drop-down. Select the project you are interested in and Save.
Related pages
Last updated
Was this helpful?