JS, TS, Go, Python, PHP, etc. project
Using YAML or the Azure Classic editor to create the Azure build pipeline for JavaScript, TypeScript, Go, Python, PHP, and other projects.
This page explains how to add the SonarQube Community Build analysis to your Azure build pipeline for projects that are not Maven, Gradle, or .NET.
Before you begin, see the Azure Pipelines integration overview page.
Once you have created and set up your SonarQube Community Build project, check out the Creating and configuring your project and Setting up project integration pages for information about adding the SonarQube analysis to your Azure build pipeline.
To create your Azure build pipeline, you can use either YAML or the Azure Classic editor.
If you need to use a specific scanner version, see the Using various features page.
Using YAML
Add the following SonarQube tasks to your YAML pipeline:
Before your build task, add a Prepare Analysis Configuration task.
After your build task, add a Run Code Analysis task.
After the Run Code Analysis task, add a Publish Quality Gate Result task.
See the YAML file example below. See also our YAML pipeline templates. For information about the SonarQube task inputs, see the SonarQube tasks for Azure Pipelines page.
Using the Classic editor
In the procedure below, the manual configuration mode is used to define analysis parameters at the pipeline level. You may use the sonar-project.properties file instead (or another specified configuration file). For more information, see the Using various features page.
Proceed as follows:
In the Azure DevOps’ Classic editor, create or edit your build pipeline.
Add a Prepare Analysis Configuration task before your build task:
In SonarQube Service Endpoint, select the SonarQube Server service connection you created during setup. See the Setting up project integration page for more information about adding a connection.
Under Choose a way to run the analysis, select Use Standalone SonarScanner CLI.
Select the Manually provide configuration mode.
In the Project key field, enter your project key.
Add a new Run Code Analysis task after your build task.
Add a new Publish quality gate Result on your build pipeline summary.
Ensure that the pipeline runs automatically for all the branches you want:
Under the Triggers tab of your pipeline, select Enable continuous integration and select all the branches for which you want SonarQube Community Build analysis to run automatically.
Save your pipeline.
Related pages
Using various features when adding the analysis to your pipeline
Last updated
Was this helpful?

