Skip to end of metadata
Go to start of metadata

Table of Contents

Legacy Windows Workflow / XAML-based build system

The following section refers to the new build system available since Team Foundation Server 2015 and on VSTS. Refer to the Team Foundation Server 2013 documentation if you are using the Windows Work / XAML-based build system.


Hosted build agents on Visual Studio Team Services already meet the prerequisites listed here.

  1. Make sure the .NET Framework v4.5.2+ is installed
  2. Make sure the Java Runtime Environment v7u75+ is installed

Add a SonarQube Service endpoint

  1. From the Team Project settings manager, click on Services
  2. Create a new Generic Service Endpoint

  3. Enter the SonarQube server and credentials and click Ok

    If you wish to use an analysis token instead of a username and password, enter it under User name field

Enable the SonarQube analysis in the build definition

  1. Open the new build definition or edit build definition interface
  2. Open the Add build step... dialog
  3. Add both the SonarQube for MSBuild - Begin Analysis and SonarQube for MSBuild - End Analysis build steps to your build definition
  4. Click on the SonarQube for MSBuild - Begin Analysis build step to open its configuration dialog
  5. Select the SonarQube Endpoint to be used for the analysis
  6. Configure the SonarQube Project Key, Name and Version
  7. The actual build of your project should occur in between the SonarQube begin and end analysis steps

    You can also build your project using the MSBuild build step instead of the Visual Studio Build step.

  8. Optional: To import code coverage into SonarQube, add the Visual Studio Test build task after the build one and tick Code Coverage Enabled
  9. Save the build definition

Launch a new build, wait for it to complete. If the build succeeded, you should now see a new SonarQube section on the build dashboard:

  • No labels