SonarQube tasks for Azure Pipelines
Tasks supported by the Azure DevOps Extension for SonarQube Server you can use in your Azure build pipeline.
Examples of each SonarQube task described on this page can be found in code samples located on pages in this section of the docs. Select your project type from the pages listed on the Adding analysis to Azure pipeline page, then read through the setup instructions to locate the example pipeline to reference.
For more information about customizing your Azure pipeline with the task inputs listed below, please see the Using various features page.
Prepare Analysis Configuration task
This task configures the required settings before executing the build. For .NET solutions or Java projects, it helps integrate seamlessly with MSBuild, Maven, and Gradle tasks.
The Prepare Analysis Configuration task shows up in your Azure pipeline as task: SonarQubePrepare@X
where
X= the current version of the Azure DevOps Extension for SonarQube Server.
Run Code Analysis task
This task executes the analysis of the source code. It is not used in the Gradle / Maven mode of the Azure DevOps extension for SonarQube Server.
The Run Code Analysis task shows up in your Azure pipeline as task: SonarQubeAnalyze@X
where
X= the current version of the Azure DevOps Extension for SonarQube Server.
The table below lists the task inputs.
jdkversion
The version of Java used by the scanner for analysis. See General requirements.
If you select a value other than JAVA_HOME, the analyze task will revert to using JAVA_HOME if the selected environment variable does not exist.
Possible values:
• JAVA_HOME: Use the value of the JAVA_HOME environment variable on the system.
• JAVA_HOME_17_X64: Use the value of the JAVA_HOME_17_X64 environment variable on the system, if available. This environment variable is already set when running on Microsoft-hosted agents.
• JAVA_HOME_21_X64: Use the value of the JAVA_HOME_17_X64 environment variable on the system. This environment variable is already set when running on Microsoft-hosted agents.
Default: JAVA_HOME
Publish Quality Gate Result task
This task allows you to report the quality gate status directly to your Azure Pipeline’s Build Summary page. It is not mandatory but highly recommended.
The Publish Quality Gate Result task shows up in your Azure pipeline as task: SonarQubePublish@X
where
X= the current version of the Azure DevOps Extension for SonarQube Server.
The table below lists the task inputs.
pollingTimeoutSec
The maximum time (in seconds) for the task to wait for the analysis results sent by SonarQube Server.
Default: 300
Related pages
Last updated
Was this helpful?

