Template for a good new topic, formatted with Markdown:
- ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
Azure DevOps Services
- CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
Azure DevOps Services
- Scanner command used when applicable (private details masked)
dotnet sonarscanner begin /k:"$SONAR_PROJECT_KEY" /o:"$SONAR_OGRANIZAION" /d:sonar.host.url="$SONAR_HOST_URL" /d:sonar.login="$SONAR_TOKEN" /d:sonar.cs.opencover.reportsPaths=/coverage.opencover.xml /d:sonar.pullrequest.key="$PR_ID" /d:sonar.pullrequest.branch="$BRANCH_NAME" /d:sonar.pullrequest.base=“master”
dotnet sonarscanner end /d:sonar.login="$SONAR_TOKEN"
- Languages of the repository
C#
- Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
No error. SonarCloud correctly shows the Pull Request results on sonarcloud.io. All looks good besides the fact that the Azure DevOps PR doesn’t have any SonarCloud annotations/comments (even though there were findings on sonarcloud.io for that PR build).
- Steps to reproduce
I followed instructions from the following sources:
- Driving continuous quality of your code with SonarCloud | Azure DevOps Hands-on-Labs
- Pull Request Analysis | SonarQube Docs
I configured sonarcloud.io project in “General Settings | Pull Requests” to use provider “Azure DevOps Services” and provided a PAT token (with authorization scope: “Code (read and write)”. I even tried to use a PAT token with “full access”).
Above you can see the “dotnet sonarscanner” commands that I ran.
SonarCloud extension is installed and shows version: 1.20.1 (Latest)
We’re on a paid plan of SonarCloud.
There is no warning label on sonarcloud.io web UI like “Last analysis had 1 warning” or similar.
Maybe worth mentioning: The solution is built as part of a Docker build with “dotnet sonarscanner” executed as part of the Docker image build. I am copying “.git” folder into the Docker image so that the scanner can retrieve info about e.g. author of changes (and they are correctly reflected on the sonarcloud.io report page). IOW I’m not using the SonarCloud Azure DevOps pipeline tasks but instead the “dotnet sonarscanner” tool inside the Docker image build.
Any suggestions on what I’m doing wrong? Or is there a way to see some logs that would point me in the right direction?
I have reviewed posts that looked similar to my issue, but unfortunately I wasn’t able to address my issue: