In the post Setup SonarQube Analysis with TFS Builds usage of Sonar Server with TFS build to measure quality of code is explained. The task catalogue tasks explained in the post Setup SonarQube Analysis with TFS Builds are now deprecated. There is an extension available in marketplace for SonarQube. This extension provide new begin analysis and end analysis tasks to be used in a TFS build.
Once you install the SonarQube extension for VSTS/TFS you can setup service endpoint type of SonarQube.
This endpoint requires a token as shown below. Server URL is the URL of your Sonar Server.
To generate a token go to Sonar server and create a user named like ProjectFeeder (can be any name) with following sonar-users permissions. By default all users get create project and execute analysis permissions that is sufficient to execute analysis with TFS/VSTS builds..
Logout from admin user and login with project feeder user to generate a token.On My Account of the Project Feeder user, in the security tab provide a name and generate a token. Then use that token in TFS/VSTS service endpoint.
Once a build is setup sonar analysis and queued the build summary provides a link to the analysis results. Quality gate status is shown in the build summary.
Link will take you to the Sonar Server details of the analysis. You can drill down each item in the Sonar Server dashboard.