Importing Bitbucket Cloud repositories

How to import your Bitbucket Cloud repositories into SonarQube Community Build.

Once the integration of your SonarQube instance with Bitbucket Cloud has been properly set up, you can import a Bitbucket Cloud repository to create the corresponding project in SonarQube. To do so, you need the Create Project permission in SonarQube.

The so-created SonarQube project is "bound" to its Bitbucket Cloud repository. With a bound project:

  • The project’s main branch name will be automatically set up from Bitbucket.

Step 1: Create an API token

You must provide a Bitbucket Cloud API token. Your API token needs the read:repository:bitbucket scope (Read permission for the repositories). To avoid exceeding Bitbucket Cloud API rate limits, it is recommended to use a dedicated Bitbucket user for SonarQube integration.

Step 2: Import one or several repositories

  1. In the top right corner, select Create Project > From Bitbucket Cloud. The Bitbucket Cloud project onboarding page opens.

  2. In the top navigation bar of SonarQube, select the Projects tab.

The first time you import a Bitbucket Cloud repository into SonarQube, you must enter a username and an App password.
  1. In Bitbucket user name, enter your email address.

  2. In App password, enter the API token you created in Step 1.

  3. Select Save. The projects and repositories to which the PAT has access are listed on the page.

  4. Select one or several repositories to be imported and follow the instructions.

Setting up Bitbucket Cloud integration at global level Adding analysis to Bitbucket pipeline Troubleshooting

Last updated

Was this helpful?