Setting up Bitbucket Cloud integration at global level
How to set up Bitbucket Cloud and SonarQube Server 2025.6 for integration at the global level.
This section explains how to set up Bitbucket Cloud and SonarQube to allow users to import Bitbucket Cloud repositories. To perform this setup, you need the global Administer System permission in SonarQube.
For more information about the Azure DevOps integration solution, see Introduction to Bitbucket Cloud integration.
Prerequisites
You’ve set a SonarQube Server base URL in SonarQube Server: see Server base URL.
Step 1: Create your OAuth client
SonarQube Server uses a dedicated OAuth client to report your quality gate status on pull requests. When you create your OAuth client, Bitbucket Cloud generates a client ID and a secret that you need in Step 2.
Proceed as follows:
In your Bitbucket Cloud workspace settings, create an OAuth client and specify the following:
On the Details tab, Name: The name of your OAuth client.
On the Authorization tab, Supported grant types: Select Client credentials. SonarQube Server does not use the Authorization code or Refresh token grant types, so you do not need a callback URL.
On the Scopes tab: Grant Read access for the Pull requests permission.
Retrieve the client ID and secret of your OAuth client in your Bitbucket Cloud workspace settings under OAuth clients. In Step 2, enter the client ID in OAuth Key and the secret in OAuth Secret. If you want to enter the secret in SonarQube Server in encrypted format, you can encrypt this secret.
See Sensitive settings for more information about settings encryption.
Step 2: Create a Bitbucket Cloud configuration record
This integration is performed through a "Bitbucket Cloud Configuration" record, which is used in SonarQube to access the Bitbucket Cloud instance.
To set up a Bitbucket Configuration in SonarQube:
Go to Administration > Configuration > General Settings > DevOps Platform Integrations.
Select the Bitbucket tab and click Create configuration. The Create a configuration dialog opens.
Select Bitbucket Cloud.

Specify the following settings:
Configuration Name (Enterprise and Data Center Edition only): The name used to identify your Bitbucket Cloud configuration at the project level. Use something succinct and easily recognizable.
Workspace ID: The workspace ID is part of your bitbucket cloud URL
https://bitbucket.org/<workspace-id>/<repository-slug>OAuth Key: The key you created in Step 1.
OAuth Secret: The secret you created in Step 1.
Related pages
Importing Bitbucket Cloud repositories Setting up Bitbucket Cloud integration for your project Adding analysis to Bitbucket pipeline Troubleshooting
Last updated
Was this helpful?

