This version of SonarQube Server is no longer receiving patches. Please see the latest release for details on updating.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

For AI agents: You're in the SonarQube Server 2025.6 documentation. SonarQube Server 2025.6 is no longer patched. To get patches, upgrade to the latest version. For a list of all 2025.6 pages, see the SonarQube Server 2025.6 page index. For the whole site, see the page index or the full text. For another version, replace 2025.6 in the URL with that version. The latest version has no version number in its URL.

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.

To set up Bitbucket Cloud authentication in your SonarQube Server instance, see Bitbucket Cloud.

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:

  1. 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.

  2. 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.

Starting in SonarQube Server's Enterprise edition, you can integrate SonarQube with multiple Bitbucket Cloud instances, each instance being accessed with a different Bitbucket Configuration.

To set up a Bitbucket Configuration in SonarQube:

  1. Go to Administration > Configuration > General Settings > DevOps Platform Integrations.

  2. Select the Bitbucket tab and click Create configuration. The Create a configuration dialog opens.

  3. Select Bitbucket Cloud.

Select Bitbucket Cloud in the Create a configuration dialog.
  1. 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.

Importing Bitbucket Cloud repositories Setting up Bitbucket Cloud integration for your project Adding analysis to Bitbucket pipeline Troubleshooting

Last updated

Was this helpful?