Authorization Issue

Hi Team

We are hosting our SonarQube instance on Azure Kubernetes Service (AKS) and recently upgraded from SonarQube 9.0 Enterprise to 9.9 Enterprise.

After the upgrade, we encountered an authorization issue while trying to analyze a project. Below are the relevant logs from the pipeline:

##[error]18:56:20.257 ERROR Error during SonarScanner CLI execution
18:56:20.257 ERROR You’re not authorized to run analysis. Please contact the project administrator.
18:56:20.257 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.
##[error][ERROR] SonarQube Server: Error while executing task Analyze:
The process ‘D:\a_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\7.3.0\sonar-scanner\bin\sonar-scanner.bat’
failed with exit code 1


Here is the relevant section of our pipeline configuration:
- task: SonarQubePrepare@7
  inputs:
    SonarQube: 'sonarqube-svc-connection-new'
    scannerMode: 'cli'
    configMode: 'manual'
    cliProjectKey: 'food_safety_1'
    cliProjectName: 'food_safety_1'
    cliSources: '.'


Steps we’ve already taken:

* Created a new project (`food_safety_1`) and retried the analysis.
* Updated our Azure DevOps service connection to use a **Project Analysis Token** and also tested with a **Global Analysis Token**.
* Granted the user full permissions in the **project settings**, including **Admin** and **Execute Analysis** rights.
* Ensured the permission template is applied to the project with proper scan permissions for the user/group.

Despite these actions, we are still getting the same authorization error.

Please help us identify if there is any additional configuration needed post-upgrade or if there's a known issue with version 9.9 related to project analysis permissions.

Hey there!

Could you turn on DEBUG level logging to see the exact query that’s being rejected and what status code is being returned? You can add This would tell us if:

  • Authentication is missing
  • Authentication with a user insufficient permissions
  • Which permission might be missing

In Azure DevOps you can do this by adding

    extraProperties: |
      sonar.verbose=true

to the SonarQubePrepare task.