In this article we will explore sonarcloud integration with Azure DevOps Pipelines. mn
To configure your project with sonarcloud you need a active subscription, you can get started from here.
Once you are logged in, you may need to create an organization first by clicking top + icon on the right.
Once you have clicked on the + icon, you get the screen to create organization. You can either import organization details from Github(if you used Github login) or manually create the organization, select create manually for the time being.
Next it will ask you to pick a plan, if you have a private project then you may need to opt for paid plan. To get started lets pick free plan as it offers free code analysis for public projects.
and click on Create Organization.
You get the dashboard for your organization, click on analyse a new Project.
Fill in the project details and select Public, click on Setup.
Now go back to Azure DevOps organization and create a Service Connection for sonarcloud. You can simply click on link to generate token and verify the connection.
Before you can use sonarcloud in your pipeline, you will need to install an extension from marketplace in you Azure DevOps organization from that you can get here.
Once you have installed the extension to your Azure DevOps organization, it makes couple of task available in pipeline to be added.
Add Prepare Analysis Configuration task in your pipeline.
After that you will need add other two task for analysis and publishing the results. And click on Run to queue the build.
After running the build, you shall be able to see the analysis on sonarcloud Project dashboard.