Error observed:
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 47.168s
INFO: Final Memory: 7M/27M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
Steps to reproduce
Every time PR build is scheduled
Potential workaround
We are using “Prepare Code Analysis for SonarCloud” and “Run Code Analysis” steps in build pipeline,
sometime last week Run code analysis started to fail for PR builds with error above.
When build is manually triggered for a branch everything work fine.
Thanks for clarifying,
I don’t think I ever configured that, so it’s expected that it shows invalid for me.
The way I configured projects:
Added them in Sonar Cloud UI and generated project key and token
Created service connection in Azure Dev Ops using token from #1 (and my screenshot above)
Used that project specific connection in the build pipeline for “Run Code Analysis” step
Everything worked fine until 4/8 - 4/9, my initial thought was that new version of SonarCloud was deployed and they changed the way you need to authenticate.
But obviously that is just a guess.
If you were decorating pull request ever since, you need somehow a personal access token. If you haven’t linked your Azure DevOps organization with the SonarCloud, then this PAT is most likely setup in the setting of the project itself (On your project overview, go to Administration, General Settings, then click on Pull Request)
Let me try to configure it with personal token to see if that helps, while I still want to figure out why current configuration broke that seems like a reasonable workaround.