Published reports from Azure DevOps not displaying in SonarCloud


I successfully integrated SonarCloud into our instance of Azure DevOps and I followed the steps on my dashboard to integrate the SonarCloud steps into my build pipeline. I am currently working out of a ‘short-lived branch’ to test these changes in my YAML file before I merge them into main. I have run my build a number of times but there is no data in SonarCloud at all. I am not real sure what the problem is, the logs all say that everything is succeeding but it doesn’t look like data is making its way up. This is a C# project that I am trying to build.

I set sonar.verbose = true and in my Analyze step I can see that a report was generated and the report was POSTed to the SonarCloud API. Happy to provide additional details.

The relevant sections of my YAML file are below. Any help you can provide would be greatly appreciated!

    - task: SonarCloudPrepare@1
        SonarCloud: 'Sonar Cloud - sms'
        organization: '[my org]'
        scannerMode: 'MSBuild'
        projectKey: '[my key]'
        projectName: '[my project]'
    - task: VSBuild@1
      displayName: 'Build WebV2'
        solution: $(WebV2Project)
        msbuildArgs: $(MsBuildArgs)
        platform: $(BuildPlatform)
        configuration: $(BuildConfiguration)
        maximumCpuCount: true
    - task: SonarCloudAnalyze@1
    - task: SonarCloudPublish@1
        pollingTimeoutSec: '300'

Hey there.

There should be a URL at the end of the analysis in the logs.

INFO: ANALYSIS SUCCESSFUL, you can find the results at:

Where does it take you, and what do you see?

It takes me to the Summary view in the Sonar Dashboard associated to the branch I am working out of. There are no issues, security hotspots, coverage metrics, etc. Further, if I go to the Code tab and search for a file that is in the repo, no results are returned.

This was a misunderstanding on my part of how the scanner works for short-lived branches. Reading through the docs I see that the reason nothing was showing up was because I wasn’t pushing any new code, I was just running the build. I believe this is working as expected.