'Insufficient Privileges' when creating a new project from Azure DevOps Pipeline


(Raymon) #1

I am trying to create a new project in SonarCloud, directly from a build pipeline in Azure DevOps, using an InvokeRestApi task. Whenever I try to make the POST-request to create a new project, I get a 403 response saying “insufficient privileges”. I have set up a Service Connection in my project and I send a token in the Authorization header of the request. Not sending the token or setting up the Service Connection results in a 401 error, so I would assume this is the correct setup.
Running the same request in Postman, with the same headers and parameters, results in a succesfull request and creates a new project. I have checked permissions of the user that I generated the token for and it has full rights. The request url looks like this: https://sonarcloud.io/api/projects/create?key=ProjKey&name=ProjName&visibility=private&organization=MyOrganization.
Any suggestions on how to solve this are welcome!

(Raymon) #2

Problem has been solved internally.
For future reference, should anyone require it: a password got entered in the Service Connection settings somewhere during setup. After making sure we had a Service Connection with empty password, the authorization succeeded