> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/ai-dlc-insights/use-ai-dlc-insights/setup/integrations/bitbucket/bitbucket-data-center.md).

# Connect with Bitbucket Data Center

Bitbucket is a web-based version control repository hosting service, for source code and development projects that use either Mercurial or Git revision control systems.

This page describes the settings and permissions for the Bitbucket integration. Harness SEI supports both Cloud and Data Center (On-Prem) versions of Bitbucket. The following settings are applicable to Bitbucket Data Center.

#### Requirements <a href="#requirements" id="requirements"></a>

The following permissions and settings are required to use the SEI Bitbucket integration:

* You have a Bitbucket account.
* Your role is **Member** or higher.

{% hint style="info" %}
If you have enabled an allow list in your Bitbucket account, certain Harness IP addresses must be added to it in order to allow communication between the Harness Platform and Bitbucket. If the necessary IPs are not whitelisted, the integration may fail to authenticate or sync data properly.

To ensure your integration can work correctly, please refer to the list of [Harness Platform IPs](/harness-ai/use-harness-platform/references/allowlist-harness-domains-and-ips.md) that may need to be whitelisted in your firewall.
{% endhint %}

#### Add the integration <a href="#add-the-integration" id="add-the-integration"></a>

[Bitbucket Data Center (also known as Bitbucket Enterprise)](https://www.atlassian.com/software/bitbucket/enterprise) is a self-managed solution for source code collaboration. Harness SEI supports connecting with both private and public Bitbucket On-Prem instances.

1. In your **Harness Project**, select the **SEI Module**, and go to your **Account**.
2. Select **Integrations** under **Data Settings**.
3. Select **Available Integrations**, and locate the **Bitbucket integration**, and select **Install**.
4. Select the type of your Bitbucket account as **Data Center**.
5. Choose **Authentication Method**:
   1. Use **Personal Access Token (PAT)** to connect to a **Public On-Prem Bitbucket** server.
   2. Use **Ingestion Satellite** to connect to a **Private On-Prem Bitbucket** server.

{% tabs %}
{% tab title="Direct Public Connection" %}

1. Enter a **Name** for the integration.
2. The **Description** and **Tags** are optional.
3. Enter the **URL** for the **Bitbucket Public On-Prem Instance** in the format `https://bitbucket.org/<TEAMNAME_OR_USERNAME>/<REPOSITORY_NAME>/src`
4. In the **Username** field, enter the Bitbucket account username as specified in your **Bitbucket Account settings**.
5. Enter the **Bitbucket Personal Access Token**. To generate an PAT token for your Bitbucket account, go to [Managing PAT tokens for Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/create-a-repository-access-token/).
6. Enter **Tags** and the **List of repositories** you want to ingest. You can leave this option blank if you want to ingest all the repositories from organizations accessible to the token user.
7. You can select the **Filters** to define the type of data you want to ingest. The available options are **Fetch Commits**, **Fetch PRs**, **Fetch PRs Reviews**, **Fetch Commits Fields**.
8. Click on **Validate Connection** to run the pre-flight checks and validate the connection. Once successful, you'll have the integration set up under the **Your Integrations** tab.
   {% endtab %}

{% tab title="Using Ingestion Satellite" %}

1. Enter a **Name** for the integration.
2. The **Description** and **Tags** are optional.
3. Enter the **URL** for the **Bitbucket Public On-Prem Instance** in the format `https://bitbucket.org/<TEAMNAME_OR_USERNAME>/<REPOSITORY_NAME>/src`
4. In the **Username** field, enter the Bitbucket account username as specified in your **Bitbucket Account settings**.
5. Enter the **Bitbucket Personal Access Token**. To generate an PAT token for your Bitbucket account, go to [Managing PAT tokens for Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/create-a-repository-access-token/).
6. Enter **Tags** and the **List of repositories** you want to ingest. You can leave this option blank if you want to ingest all the repositories from organizations accessible to the token user.
7. You can select the **Filters** to define the type of data you want to ingest. The available options are **Fetch Commits**, **Fetch PRs**, **Fetch PRs Reviews**, **Fetch Commits Fields**.
8. Download the `satellite.yml` file and update it following the instructions [here](/software-engineering-insights/use-software-engineering-insights/setup-sei/sei-ingestion-satellite/satellite-overview.md).

If you experience any issues while configuring the integration using the Ingestion Satellite, refer to the [Ingestion Satellite Troubleshooting and FAQs](/software-engineering-insights/use-software-engineering-insights/setup-sei/sei-ingestion-satellite/satellite-troubleshooting-and-faqs.md).

Here’s a sample `satellite.yaml`:

```yaml
satellite:
  tenant: <ACCOUNT_ID>
  api_key: <ACCOUNT_API_KEY>
  url: 'https://app.harness.io/gratis/sei/api' 
  # Note that this URL is relative to the Environment of your Harness Account

integrations:
  - id: '<INTEGRATION_ID>'
    application: bitbucket_server
    url: 'https://bitbucket.org/<TEAMNAME_or_USERNAME>/<REPO_NAME>/src'
    username: <BITBUCKET_USERNAME>
    api_key: <BITBUCKET_API_KEY>
    metadata:
      fetch_prs: true
      fetch_pr_reviews: true
      fetch_commits: true
      fetch_commit_files: true
      repos: <REPOSITORIES>
    satellite: true

```

{% endtab %}
{% endtabs %}

#### See also <a href="#see-also" id="see-also"></a>

* [Connect with Bitbucket Cloud](/software-engineering-insights/use-software-engineering-insights/setup-sei/configure-integrations/bitbucket/sei-bitbucket-cloud.md)
* [Reauthenticate](/software-engineering-insights/use-software-engineering-insights/setup-sei/configure-integrations/reauthenticate-integration.md)
* [Ingested data](/software-engineering-insights/use-software-engineering-insights/setup-sei/configure-integrations/bitbucket/sei-bitbucket-datasheet.md)
