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.
Bitbucket's API tokens replace the App passwords which are deprecated. See the Bitbucket documentation for more details.
Step 2: Import one or several repositories
- In the top right corner, select Create Project > From Bitbucket Cloud. The Bitbucket Cloud project onboarding page opens. 
- In the top navigation bar of SonarQube, select the Projects tab. 

- In Bitbucket user name, enter your email address. 
- In App password, enter the API token you created in Step 1. 
- Select Save. The projects and repositories to which the PAT has access are listed on the page. 
- Select one or several repositories to be imported and follow the instructions. 
Related pages
Setting up Bitbucket Cloud integration at global level Adding analysis to Bitbucket pipeline Troubleshooting
Last updated
Was this helpful?

