Introduction to Bitbucket Cloud integration
SonarQube Server’s integration with Bitbucket Cloud allows you to maintain code quality and security in your Bitbucket Cloud repositories.
Key features
With this integration, you’ll be able to:
Import your Bitbucket Cloud repositories: Import your Bitbucket Cloud repositories into SonarQube Server to easily set up SonarQube Server projects.
Analyze projects with Bitbucket Pipelines: Integrate analysis into your build pipeline. SonarScanners running in Bitbucket Pipelines can automatically detect branches or pull requests being built so you don’t need to specifically pass them as parameters to the scanner.
Report your quality gate status to your pull requests: See your quality gate and code metric results right in Bitbucket Cloud so you know if it’s safe to merge your changes.
Authenticate with Bitbucket Cloud: Sign in to SonarQube Server with your Bitbucket Cloud credentials.
Integration solution overview
Integration is performed at two levels:
Global: Within your SonarQube Server instance, a “Bitbucket Cloud Configuration” record is used to manage the SonarQube Server access to your Bitbucket Cloud workspace. This record stores:
Your workspace ID.
The key and secret of a workspace’s OAuth consumer which is used by SonarQube Server to access your Bitbucket Cloud workspace, either to report the quality gate to pull requests on the repositories you’re analyzing or to import repositories.
Project: A project administrator must provide a Bitbucket Cloud API token to import their Bitbucket Cloud repository to SonarQube Server. SonarQube stores this PAT in its database, enabling it to list and import the repositories the administrator can access.

For information about Bitbucket Cloud authentication solution, see Bitbucket Cloud.
Related pages
Setting up Bitbucket Cloud integration at global level This section explains how to set up the integration of your SonarQube Server instance with Bitbucket Cloud. You need the global Administer System permission in SonarQube to perform this setup.
Importing Bitbucket Cloud repositories Once the integration of your SonarQube Server instance with Bitbucket Cloud has been properly set up, you can import a Bitbucket Cloud repository or monorepo to create the corresponding projects in SonarQube Server.
Setting up Bitbucket Cloud integration for your project This page explains how to set up pull request decoration and the blocking of pull requests in case of quality gate failure. You need the Administer permission on the project to perform this setup.
Adding analysis to Bitbucket pipeline Once you have created your project(s) in SonarQube Server, you can add the SonarQube Server analysis to your Bitbucket pipeline.
Last updated
Was this helpful?

