Which sonar permissions necessary for api/components/search_projects

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube version: 9.7.1
    We have implemented the AzureAD plugin

  • how is SonarQube deployed: zip, Docker, Helm
    SonarQube is deployed by Helm template

  • what are you trying to achieve
    Get a total list of all projects ( api/components/search_projects ) as input for another api call api/measures/component?component=xxxxxxxxxxxx&metricKeys=coverage

  • what have you tried so far to achieve this
    I made my account member of sonar-administrators.
    Give my account all the possible global permissions within the gui.

Still get a 401 response

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

What permissions do I need to use api/components/search_projects and api/measures/component ?

I’ve found that such api calls only work with an internal account.
I can’t manage to run the API calls with an AzureAD account.

1 Like


I’m glad you worked through this.

Just to be clear, this is likely a question of getting your request properly authenticated by AzureAZ. IIRC, the Web API is expecting either basic auth or a user token.