Configure SonarQube scans on Azure DevOps pipelines
Configure SonarQube or SonarCloud scans on MS Azure DevOps pipelines. Check Azure DevOps pipeline executions for SonarQube scans on every stage of the pipeline's execution and fetch lists and details of scans from any stage to DevOps Change Velocity. Drill down on the Scan Details based on categories.
Before you begin
Ensure that you meet the following prerequisites before you configure SonarQube scans on your Azure DevOps pipeline:
- You are using a compatible SonarQube version. See DevOps Change Velocity integrations for supported tool versions.
- Connect, configure the Azure DevOps tool and discover existing repositories, orchestration tasks, and pipelines.
- Create a SonarQube tool record. For more information, see SonarQube integration with DevOps Change Velocity.
- Install the SonarQube extension from the Visual Studio Marketplace and configure branch analysis to use the Azure Devops tasks in your build definitions to analyze your projects. For more information, see SonarQube documentation.
- Install the following custom extension tasks on your Azure DevOps instance.
- ServiceNow extension to integrate Azure Pipelines with DevOps Change Velocity. For more information, see Use the ServiceNow DevOps extension for Azure DevOps and Azure DevOps custom actions.
- ServiceNow DevOps Build Sonar Registration (for Build pipelines)
- ServiceNow DevOps Release Sonar Registration task (for Release pipelines)
Role required:
- admin or sn_devops.admin in DevOps Change Velocity
- admin in Azure DevOps
- admin role in SonarQube with access to all projects that the SonarQube scans are configured on.
About this task
- Prepare analysis on SonarCloud
- Run Code analysis
- Publish Quality Gate Result
- pipelineName
- buildNumber
- stageName
- branchName
- sonarProjectKey
- sonarInstanceUrl
Procedure
Result
What to do next
- View scan details as part of Task Executions. View details of all the Sonar scans that are part of the task execution mapped to a build or release pipeline execution step.
- Navigate to click a relevant Task Execution record.
- Click the Software Quality Summary related list.
- Click a relevant Scan ID record.
- View scan details as part of Change Request. View all the scans that were part of this build/release pipeline in the related list.
- Navigate to
- Click the Software Quality Summary related list.
- Click a relevant Scan ID record.