Sonarcloud pipeline task warnings in the pipeline SonarCloudAnalyze@3 task

  • ALM used- Azure DevOps
  • CI system used Azure DevOps
  • Language - dotnet/C#

I am migrating from v2 Sonarcloud Azure Devops tasks to v3.

I was following the guidance after receiving this warning

##[warning]Task 'Prepare Analysis Configuration' version 2 (SonarCloudPrepare@2) is deprecated.
##[warning]This task is deprecated. Please upgrade to the latest version. For more information, refer to https://docs.sonarsource.com/sonarcloud/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/

SonarCloudAnalyze@3 now outputs all the findings as warnings into the pipeline.

Is there a way to change this behaviour? My initial expectation was to decrease the warnings in the pipeline, not increase them. The old task is less noisy.

Our workflow involves IDE/linters, having 0 warnings on build time, internal standards compliance check and Sonar as the last resort to validate the rest of our code, so the alerts don’t normally reach “bug” or “blocker” levels. If they do, we review the results on the SonarCloud SaaS page.

I find these warnings to be noise.It is impossible to distinguish between “useful” alert and a “recommendation” on the interface and it does more harm than good.

Hey there.

It was my understanding that this was always how the Scanner for .NET worked—the Roslyn analyzers run at build time and emit warnings that, like it or not, Azure DevOps emits as build warnings. There’s no other way to run the Roslyn analyzers.

If you switch back to v2, do the warnings disappear in the build logs, and are the issues pushed to SonarCloud the same?

1 Like

Hi there Colin, thank you very much for clarification.

It was a mistake on my part, both pipelines behave exactly the same in terms of warnings emitted.
( on my side I did not account for the branch not being scanned under certain branch conditions, thus I did not see the same warnings, even though warnings about the tasks being deprecated were emitted)

Thank you for explaining how it works under the hood.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.