Reputation: 3547
I have a Sonarcloud account and I'm trying to analyze a Visual Studio solution using SonarQube.Scanner.MSBuild.exe. I've created a token and am passing that on as the sonar.login property in the SonarQube.Analysis.xml file. I'm using https://sonarcloud.io as sonar.host.url, but I've also tried https://sonarqube.com.
Here is the relevant snippet of the configuration:
<Property Name="sonar.host.url">https://sonarcloud.io</Property>
<Property Name="sonar.login">***my*token****</Property>
<Property Name="sonar.password"></Property>
<Property Name="sonar.organization">MyOrganization</Property>
The analysis seems to run fine, but in the end when it tries to upload the analysis to Sonarcloud, I'm getting this error:
ERROR: Error during SonarQube Scanner execution
ERROR: You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator.
I've tried connecting to a local Sonarqube server and that works fine. Does anybody have any idea what's going wrong here?
Upvotes: 2
Views: 5523
Reputation: 22824
You're likely missing the sonar.organization
analysis property. You should be able to get the value from the Organization Key field on your project home page. If your project doesn't exist on the server yet, you can get it by logging in then: My Account > Organizations
Upvotes: 6