So all you need to do is to add the relevant task to your build definition:
You only need to configure the required options in the task - it comes with a pre-configured sonar-scanner.properties file so you are ready to go!
You need to create a SonarQube Endpoint like described in the other post, add the typical project key/name/version property triplet and, if you want, you can change the folder containing the source files. Also, if you have your own sonar-scanner.properties ready for use you can supply it in the Advanced pan:
Scenarios where you might want to use this task are where you don’t have a MSBuild-based project system supporting your code, so the other task would not work. Also, it is very handy with heterogeneous projects.