Configure Git credentials & connect a remote repo to Databricks

This article describes how to configure your Git credentials in Databricks so that you can connect a remote repo to Databricks Repos.

Supported Git providers

Databricks supports the following Git providers:

Databricks Repos also supports Bitbucket Server, GitHub Enterprise Server, and GitLab self-managed. To integrate with a private Git server instance that is not internet-accessible, get in touch with your Databricks representative.

GitHub or GitHub AE

Connect to a GitHub repo using a personal access token

In GitHub, follow these steps to create a personal access token that allows access to your repositories:

  1. In the upper-right corner of any page, click your profile photo, then click Settings.

  2. Click Developer settings.

  3. Click the Personal access tokens tab.

  4. Click the Generate new token button.

  5. Enter a token description.

  6. Select the repo scope and workflow scope, and click the Generate token button. workflow scope is needed in case your repository has GitHub Action workflows.

    Generate GitHub token
  7. Copy the token to your clipboard. You enter this token in Databricks under User Settings > Linked accounts.

To use single sign-on, see Authorizing a personal access token for use with SAML single sign-on.

GitLab

In GitLab, follow these steps to create a personal access token that allows access to your repositories:

  1. From GitLab, click your user icon in the upper right corner of the screen and select Preferences.

  2. Click Access Tokens in the sidebar.

    Generate GitLab token
  3. Enter a name for the token.

  4. Check the read_repository and write_repository permissions, and click Create personal access token.

  5. Copy the token to your clipboard. Enter this token in Databricks under User Settings > Linked accounts.

See the GitLab documentation to learn more about how to create and manage personal access tokens.

AWS CodeCommit

In AWS CodeCommit, follow these steps to create a HTTPS Git credential that allows access to your repositories:

  1. In AWS CodeCommit, create HTTPS Git credentials that allow access to your repositories. See the AWS CodeCommit documentation. The associated IAM user must have “read” and “write” permissions for the repository.

  2. Record the password. You enter this password in Databricks under User Settings > Linked accounts.

Azure DevOps Services

Connect to an Azure DevOps repo using a token

The following steps show you how to connect a Databricks repo to an Azure DevOps repo when they aren’t in the same Azure Active Directory tenancy.

Get an access token for the repository in Azure DevOps:

  1. Go to dev.azure.com, and then sign in to the DevOps organization containing the repository you want to connect Databricks to.

  2. In the upper-right side, click the User Settings icon and select Personal Access Tokens.

  3. Click + New Token.

  4. Enter information into the form:

    1. Name the token.

    2. Select the organization name, which is the repo name.

    3. Set an expiration date.

    4. Choose the the scope required, such as Full access.

  5. Copy the access token displayed.

  6. Enter this token in Databricks under User Settings > Linked accounts.

  7. In Git provider username or email, enter the email address you use to log in to the DevOps organization.

In Azure DevOps, follow these steps to get an access token for the repository. Azure DevOps documentation contains more information about Azure DevOps personal access tokens.

  1. Go to dev.azure.com, and then sign in to the DevOps organization containing the repository you want to connect Databricks to.

  2. In the upper-right side, click the User Settings icon and select Personal Access Tokens.

  3. Click + New Token.

  4. Enter information into the form:

    1. Name the token.

    2. Select the organization name, which is the repo name.

    3. Set an expiration date.

    4. Choose the the scope required, such as Full access.

  5. Copy the access token displayed.

  6. Enter this token in Databricks under User Settings > Linked accounts.

  7. In Git provider username or email, enter the email address you use to log in to the DevOps organization.

Bitbucket

In Bitbucket, follow these steps to create an app password that allows access to your repositories:

  1. Go to Bitbucket Cloud and create an app password that allows access to your repositories. See the Bitbucket Cloud documentation.

  2. Record the password.

  3. In Databricks, enter this password under User Settings > Linked accounts.