How to see if the extra options provided with SonarCloudPrepare@1 are used during the begin phase?

The extra properties like:

- task: SonarCloudPrepare@1
  displayName: 'Prepare analysis on SonarCloud'
  inputs:
    SonarCloud: SonarCloud
    organization: xxx
    projectKey: 'xxx'
    projectName: 'xxx'
    **extraProperties**: |
      sonar.branch.name=$(Build.SourceBranchName)
      sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx
      sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coverage  

Are these used?
Because the logging only shows:
E:\TFSOnline\_work\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.13.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe begin /k:xxx /o:xxx

1 Like

Hi @Stef_Heyenrath and welcome to the community !

Yes they are used, but not necessarily passed in the commandline.

Specifically, the 3 that you gave :

  • sonar.branch.name will not be used, as it is calculated by the extension from environement variables
  • The 2 coverage paths will be processed buy the underlying SonarScanner for .NET (MSBuild), you should normaly see them somewhere in the debug log.

HTH,
Mickaël

1 Like

Hi @Stef_Heyenrath - welcome to the community.

Build your pipeline with Azure Pipeline verbose logging turned on, then look in the log output for the SonarCloudAnalyze step.

When running the analysis in MSBuild mode with verbose logging turned on, the contents of the generated sonar-project.properties file that is used to configure the analysis will be dumped to the output, so look to see if your additional properties are included.

1 Like