- ALM used: Azure DevOps
- CI system used: Azure DevOps
- Scanner command used: MSBuild
- Language of the repository: C#
I would like to use file configMode in my Azure DevOps pipeline, mainly to exclude external library code but cannot seem to get it to recognize config files of any kind. I do not want to use the UI or pipeline .yaml file to specify the exclusions as only some developers have access to these locations.
Here is my current SonarCloudPrepare task:
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'sonarcloud.analysis'
organization: 'myorg'
scannerMode: 'MSBuild'
configMode: 'file'
configFile: 'SonarQube.Analysis.xml'
projectKey: 'my-project-key'
projectName: 'project-name'
extraProperties: |
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx
sonar.qualitygate.wait=true
I have tried both the SonarQube.Analysis.xml
format (which worked fine when I tested the self hosted SonarQube version), and the sonar-project.properties
format outlined elsewhere and neither file type seems to work. The only mention of configuration in the log output is this:
Calling the SonarScanner CLI...
INFO: Scanner configuration file: C:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.35.0\classic-sonar-scanner-msbuild\sonar-scanner-4.8.0.2856\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\a\1\.sonarqube\out\sonar-project.properties
Is it possible at all to use file configuration with SonarCloud for Azure DevOps? Do I have to resort to UI configuration instead?