> ## Documentation Index
> Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bitbucket Integration using PAT

> Connect Bitbucket Data Center to TrueFoundry using a Personal Access Token for repository access and deployments.

## Prerequisites

Before you begin, make sure you have:

* Access to your Bitbucket Data Center instance with permission to create HTTP access tokens or personal access tokens
* Permission to manage Git integrations in your TrueFoundry tenant
* A Personal Access Token from your Bitbucket Data Center instance (see [Create a Personal Access Token](#create-a-personal-access-token) at the end of this page)

## Step 1: Navigate to Integrations

In the TrueFoundry dashboard, select **Integrations** from the left sidebar.

<Frame caption="Open Integrations from the sidebar">
  <img src="https://mintcdn.com/truefoundry/RTx06vti6Fjmrcp5/images/bitbucket-dc-pat-navigate-integrations.png?fit=max&auto=format&n=RTx06vti6Fjmrcp5&q=85&s=e7538b4a1b510b09265f8f9498f55c69" alt="TrueFoundry dashboard sidebar with Integrations highlighted" width="1024" height="502" data-path="images/bitbucket-dc-pat-navigate-integrations.png" />
</Frame>

## Step 2: Open Git Integrations

On the **Integrations** page, open the **Git** tab and click **+ Add Git Credentials**.

<Frame caption="Add Git Credentials on the Git Integrations page">
  <img src="https://mintcdn.com/truefoundry/RTx06vti6Fjmrcp5/images/bitbucket-dc-pat-add-git-credentials.png?fit=max&auto=format&n=RTx06vti6Fjmrcp5&q=85&s=b45027265b464e1e49030ee471a31688" alt="Git Integrations page with the Add Git Credentials button highlighted" width="1024" height="497" data-path="images/bitbucket-dc-pat-add-git-credentials.png" />
</Frame>

## Step 3: Select Bitbucket Data Center

In the **Add New Git Credentials** panel, select **Bitbucket Data Center** as your Git provider.

<Frame caption="Select Bitbucket Data Center as the Git provider">
  <img src="https://mintcdn.com/truefoundry/RTx06vti6Fjmrcp5/images/bitbucket-dc-pat-select-provider.png?fit=max&auto=format&n=RTx06vti6Fjmrcp5&q=85&s=5db8758c7ac64c070348d97ba56cff16" alt="Add New Git Credentials panel showing Bitbucket Data Center selected among Git provider options" width="1024" height="499" data-path="images/bitbucket-dc-pat-select-provider.png" />
</Frame>

## Step 4: Select Personal Access Token

Under **Select a method**, choose **Personal Access Token**.

<Frame caption="Choose Personal Access Token as the authentication method">
  <img src="https://mintcdn.com/truefoundry/RTx06vti6Fjmrcp5/images/bitbucket-dc-pat-select-method.png?fit=max&auto=format&n=RTx06vti6Fjmrcp5&q=85&s=c5cabe891ba2ca41fcb260d4d1b110ac" alt="Authentication method selection with Personal Access Token highlighted" width="1024" height="825" data-path="images/bitbucket-dc-pat-select-method.png" />
</Frame>

## Step 5: Add credentials and submit

Fill in the **Add Bitbucket Data Center PAT** form:

* **Name** (required): A descriptive name for this integration, such as `BBDC-test-token`.
* **Personal Access Token** (required): Paste your Bitbucket Data Center PAT.
* **Access Control** (optional): Restrict which users can use this integration. Add user FQNs in the format `<user_type>:<username>` — for example, `user:prachi-jain`.

Click **Submit** to save the integration.

<Frame caption="Complete the PAT form and submit">
  <img src="https://mintcdn.com/truefoundry/RTx06vti6Fjmrcp5/images/bitbucket-dc-pat-submit-form.png?fit=max&auto=format&n=RTx06vti6Fjmrcp5&q=85&s=25c736fe2972b7c86f295d3d4157bbbf" alt="Add Bitbucket Data Center PAT form with Name, Personal Access Token, and Access Control fields" width="937" height="1024" data-path="images/bitbucket-dc-pat-submit-form.png" />
</Frame>

After submission, your Bitbucket Data Center credentials appear on the **Git Integrations** page. You can use **Manage** to view connected repositories or **Unlink** to remove the integration.

## Next steps

Once the integration is linked, you can deploy services from Bitbucket Data Center repositories and set up [GitOps CI/CD](/docs/setup-gitops-using-truefoundry) for your workloads.

<Note>
  ### Create a Personal Access Token

  If you do not already have a PAT, create one in your Bitbucket Data Center instance:

  1. Sign in to your Bitbucket Data Center instance.
  2. Open your profile settings and navigate to **HTTP access tokens** or **Personal access tokens** (the label depends on your Bitbucket Data Center version).
  3. Create a new token with a descriptive name.
  4. Grant the token permissions to read repositories. If you plan to use CI/CD features that open pull requests, also grant write access to repositories and pull requests.
  5. Copy the token value and store it securely. You will not be able to view it again after you leave the page.

  For more details, see the [Atlassian documentation on HTTP access tokens](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html).
</Note>
