Error during delete azure configuration

Community Build v26.10.0.133078
  • how is SonarQube deployed: zip
  • delete azure configuration, restore project permissions

Hello,

We are experiencing an issue with our SonarQube Community Edition instance.

I noticed that, even though I am a platform administrator, I was unable to access some projects.

I tried to restore permissions from Projects > Management, but when performing the operation SonarQube redirected me to the login page.

I then tried to delete one of the affected projects from the same page, but I experienced the same behavior and was redirected to the login page again.

After checking the SonarQube web logs, I found the following error:

Plain Text

ERROR web[][o.s.a.c.a.AzureDevOpsHttpClient]

Unable to contact Azure DevOps server for request

[https://dev.azure.com//_apis/projects?api-version=3.0]:

Invalid personal access token

The error is repeated periodically in the logs.

I therefore suspected that the issue could be related to an existing Azure DevOps integration configured with an expired or invalid Personal Access Token.

I tried to remove the Azure DevOps configuration from Administration > Configuration > DevOps Platform Integrations, but this operation also redirects me to the SonarQube login page, and the same Invalid personal access token error appears in the logs.

At the moment, the invalid Azure DevOps configuration therefore seems to prevent us from performing administrative operations such as:

  • restoring project permissions;
  • deleting projects;
  • removing the Azure DevOps integration itself.

How can we remove or disable this Azure DevOps integration if it cannot be removed from the SonarQube UI?

Is there a supported alternative procedure or API that can be used to delete/reset the configuration without requiring a valid Azure DevOps PAT?

Thank you for your support.

Best regards,
Bruna

Hello Bruna,

Deleting a DevOps platform configuration should not require a valid Azure DevOps PAT. The deletion operation removes the configuration locally without validating the token against Azure, so the PAT error alone does not explain the redirects to the login page.

There is a Web API alternative. Using a SonarQube user token belonging to an account with Administer System permission, first retrieve the configuration key:

curl -i   -H "Authorization: Bearer $SONAR_TOKEN"   "$SONAR_URL/api/alm_settings/list_definitions"

After confirming the correct configuration key, you can delete it with:

curl -i --request POST   -H "Authorization: Bearer $SONAR_TOKEN"   --data-urlencode "key=AZURE_CONFIGURATION_KEY"   "$SONAR_URL/api/alm_settings/delete"

Replace $SONAR_URL with your SonarQube base URL and AZURE_CONFIGURATION_KEY with the key returned by the first request. A successful deletion returns HTTP 204 No Content. Please note that this also removes the associated project bindings and stored per-user Azure PATs for that configuration, so only run it if you intend to remove the integration.

You can check these endpoints in your instance’s built-in Web API documentation. See also the Community Build Web API documentation for authentication details.

To investigate the login redirects, could you also provide:

  • Whether SonarQube is behind a reverse proxy or WAF.

  • The HTTP status and response body of the failed deletion request, captured in your browser’s Developer Tools under Network with Preserve log enabled.

  • The corresponding web.log entries with logging temporarily set to DEBUG. In particular, check for Wrong CSRF in request. Please restore the previous logging level afterward.

A proxy rewriting authentication or CSRF cookies is one possible explanation for redirects during multiple administrative operations, but we would need the request details and logs to confirm the cause here.

Please redact tokens, cookies, and authorization headers before sharing any output. There should be no need to edit the database directly.