Bitbucket connector settings reference
Harness connects to Bitbucket repositories through Bitbucket connectors.
This topic describes the settings and permissions for the Bitbucket connector. Harness supports both Cloud and Data Center (On-Prem) versions of Bitbucket. The following settings are applicable to both versions.
What you will learn from this topic
How to configure the Overview and Details settings for a Bitbucket Cloud or Data Center connector.
How to choose an authentication method for HTTP or SSH connections, including API tokens, access tokens, and SSH keys.
How to set the Connectivity Mode and troubleshoot common connection failures.
Overview settings
Name: The unique name for this connector. Harness generates an Id (Entity Identifier) based on the Name. You can edit the Id during initial connector creation. Once you save the connector, the Id is locked.
Description: Optional text string.
Tags: Optional labels you can use for filtering. For details, go to the Tags reference.
Details settings
The Details settings specify which BitBucket account or repository you want this connector to connect to, whether to connect over HTTP or SSH, and the URL to use.
URL Type
Select Account to connect an entire Bitbucket account. This option lets you use one connector to connect to all repositories in the specified Bitbucket account. Make sure you have at least one repo in the account; you need a repo to test the connection and save the connector.
Select Repository to connect to a single, specific repo in a Bitbucket account.
Connection Type
Select the protocol, HTTP or SSH, to use for cloning and authentication. The Connection Type determines the URL format required for the Bitbucket Account/Repository URL field. It also determines the Authentication method you must use in the Credentials settings.
Bitbucket Account/Repository URL
Enter the URL for the Bitbucket account or repository that you want to connect to. The required value is determined by the URL Type, Connection Type, and your Bitbucket account type (Cloud or Data Center).
In the Bitbucket Account URL field, provide only the account-identifying portion of the Bitbucket URL, such as https://bitbucket.org/my-bitbucket/. Do not include any repo name or project name.
The URL format depends on the Connection Type and your Bitbucket account type (Cloud or Data Center). The following table provides format examples for each combination.
HTTP
https://bitbucket.org/USERNAME/ or https://bitbucket.org
https://bitbucket.YOUR-ORG-HOSTNAME/scm/
SSH
git@ssh.bitbucket.org:USERNAME/
git@bitbucket.YOUR-ORG-HOSTNAME/

In the Bitbucket Repository URL field, provide the complete URL to the Bitbucket repository that you want this connector to point to.
The URL format depends on the Connection Type and your Bitbucket account type (Cloud or Data Center). The following table provides format examples for each combination.
HTTP
https://bitbucket.org/USERNAME/REPO-NAME.git
https://bitbucket.YOUR-ORG-HOSTNAME.com/scm/PROJECT-ID/REPO-NAME.git
SSH
git@ssh.bitbucket.org:USERNAME/REPO-NAME.git
git@bitbucket.YOUR-ORG-HOSTNAME/PROJECT-ID/REPO-NAME.git

Test Repository
This field is only required if the URL Type is Account. Provide a path to a repo in your Bitbucket account that Harness can use to test the connector. Harness uses this repo path to validate the connection only. When you use this connector in a pipeline, you will specify a true code repo in your pipeline configuration or at runtime.
For Bitbucket Cloud accounts, the Test Repository path format is: REPO-NAME.git.

For BitBucket Data Center (On-Prem) accounts, you must include the project ID, such as PROJECT-ID/REPO-NAME.git.

Credentials settings
Provide authentication credentials for the connector.
Authentication
The Connection Type you chose in the Details settings determines the Authentication method.
The HTTP Connection Type requires Username and Password authentication for all accounts and repos, including read-only repos.
Username
In the Username field, enter your Bitbucket account username. You can find your username in your Bitbucket Account settings. You can use either plaintext or a Harness encrypted text secret.
Password
In the Password field, provide one of the following authentication credentials. All passwords are stored as Harness encrypted text secrets.
For Bitbucket Cloud:
API Token (recommended): Use an API token with your username. API tokens are the recommended authentication method for Bitbucket Cloud. Go to Create an API token to generate one with the required scopes.
Access Token: Use an access token with your username. If you use an access token, the Username must be
x-bitbucket-api-token-auth.App Password (deprecated): App Passwords are deprecated and will stop working after June 9, 2026. Migrate to API tokens. Go to Migrate from App Passwords to API tokens to complete the migration.
For Bitbucket Data Center (On-Prem):
HTTP Access Token: Use an HTTP access token with your username.
You must provide an account-level or workspace-level token. Repo-level tokens are not supported.
The SSH Connection Type requires an SSH Key in PEM format. OpenSSH keys are not supported. In Harness, SSH Keys are stored as Harness SSH credential secrets. When creating an SSH credential secret for a code repo connector, the SSH credential's Username must be git. Always save the ssh key as a file secret.
For details on creating SSH keys and adding them to your Bitbucket account, go to the Bitbucket documentation about Configuring SSH and two-step verification.
Enable API access
You must enable API access to use Git-based triggers, manage webhooks, or update Git statuses with this connector. If you are using the Harness Git Experience, this setting is required. API access allows authentication via multiple methods.
HTTP API Base URL for SSH connectors with context paths
When you use an SSH connector to connect to a Bitbucket Data Center server that has a context path, you may need to provide the HTTP API Base URL explicitly. A context path is a URL segment that appears between the hostname and the repository path, such as /bitbucket in https://example.com/bitbucket/scm/project/repo.git.
SSH URLs (such as ssh://git@example.com:7999/project/repo.git) do not contain context path information. Without this information, Harness cannot construct the correct HTTP URL for API calls.
The HTTP API Base URL field appears when you enable API access. You can leave this field empty for most connector configurations. You must provide a value only when all of the following are true:
You are connecting to Bitbucket Data Center (On-Prem) (not Bitbucket Cloud)
You select SSH as the Connection Type
Your Bitbucket server uses a context path in its HTTP URLs
Bitbucket Cloud does not use context paths. Bitbucket Data Center (On-Prem) HTTP connectors already contain the context path in their connection URL.
In the HTTP API Base URL field, enter the complete HTTP base URL including the context path. Do not include /scm/ or repository-specific paths. Provide only the base URL up to and including the context path.
URL format: https://HOST/CONTEXT-PATH
Example: If your Bitbucket server is accessible at https://example.com/bitbucket, enter https://example.com/bitbucket in the HTTP API Base URL field.
This authentication method is available only for Bitbucket Cloud. It requires Harness Delegate version 26.02.88600 or later.
In the Email field, enter the email address associated with your Bitbucket account.
In the API Token field, provide a Bitbucket account-level API token stored as a Harness Encrypted Text secret. Go to Create an API token to generate one with the required scopes.

Access tokens can be scoped to a Bitbucket repository, project, or workspace. For Bitbucket Cloud connectors, Harness recommends using a workspace-level access token. With Delegate version 26.02.88600 and later, repository-level tokens cannot list workspaces, which causes Test Connection and repository listing to fail.
When you select the access token method, provide the reference to a secret containing your Bitbucket access token (stored as a Harness Encrypted Text secret) in the Access Token field.
Go to the Bitbucket documentation to review the features and limitations of Bitbucket access tokens.
Create an API token
To use API token authentication, you must create an API token in Bitbucket with the required scopes.
Steps to create an API token
Go to Bitbucket API Tokens Page
Click Create API token with scopes.
Enter a label for your token (for example, "Harness Connector").
Set an expiry date (maximum is one year).
Select Bitbucket as the workspace.
Select the following required scopes:
read:issue:bitbucketread:meread:project:bitbucketread:pullrequest:bitbucketread:repository:bitbucketread:user:bitbucketread:webhook:bitbucketread:workspace:bitbucketwrite:webhook:bitbucketwrite:issue:bitbucketwrite:repository:bitbucketwrite:pullrequest:bitbucketdelete:issue:bitbucketdelete:webhook:bitbucket
Click Create.
Copy the API token immediately. You will not be able to view it again.

Store the API token as a Harness Encrypted Text secret and reference it in your connector configuration.
Migrate from App Passwords to API tokens
Migration steps
Create an API token in Bitbucket with the required scopes. Go to Create an API token to generate one with the required scopes.
Update your connector:
Open your Bitbucket connector in Harness.
In the Password field (under Credentials settings), edit the secret.
Replace the App Password with your new API token.
Save the connector.
If you enabled API access:
If you are using Username and App Password for API access, switch to Email and API Token (Bitbucket Cloud only) or Access Token.
Update the credentials accordingly.
Test the connection to verify the migration was successful.
Connectivity Mode settings
Select whether you want Harness to connect directly to your Bitbucket account or repo, or if you want Harness to communicate with your Bitbucket account or repo through a delegate. If you plan to use this connector with Harness Cloud build infrastructure, you must select Connect through Harness Platform.
Delegates Setup
If you select Connect through a Harness Delegate, you can select Use any available Delegate or Only use Delegates with all of the following tags.
If you want to use specific delegates, you must identify those delegates. Go to Use delegate selectors to tag and select specific delegates.
Kubernetes delegate with self-signed certificates
If your codebase connector allows API access and connects through a Harness Delegate that uses self-signed certificates, you must specify ADDITIONAL_CERTS_PATH in the delegate pod, as described in Configure a Kubernetes build farm to use self-signed certificates.
Troubleshooting
Here are some troubleshooting suggestions for BitBucket Connectors.
Next steps
Add a Bitbucket connector: Follow the full setup procedure for Bitbucket.
Overview: Review scopes, permissions, and connectivity options for all code repository connectors.
Last updated
Was this helpful?
