Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
A service principal is a non-human identity that automates tasks in Azure Databricks, including accessing and interacting with Git folders. This page explains how to authorize a service principal to use Git credentials for Git folder operations.
Note
If you're using Azure DevOps with Microsoft Entra ID for automation, see Authorize a Microsoft Entra service principal to access Git folders for specific configuration steps.
Link Git credentials to a service principal
To link Git credentials to a service principal:
As a workspace admin, log in to the Azure Databricks workspace.
Click your username in the top bar and select Settings.
Click the Identity and access tab.
Next to Service principals, click Manage.
Select the service principal that you want to update with Git credentials.
Click the Git integration tab.
Click Add Git credential.
Choose the Git provider from the dropdown menu and click Link.
To use a personal access token instead of linking your own Git credentials, select Personal access token and provide the token information. See Configure Git credentials & connect a remote repo to Azure Databricks.
Select the Git user account that the service principal uses for access.
Click Continue.
Click Authorize Databricks.
The service principal now uses the linked Git credentials when accessing your Azure Databricks workspace Git folder resources as part of your automation.
Retrieve service principals programmatically
Retrieve service principals for your workspace using the Databricks SDK, REST APIs, or CLI.
To use the Databricks SDK from a notebook:
- Install the Databricks SDK:
%pip install databricks-sdk --upgrade - Import
ApiClientfromdatabricks.sdk.core. - Call the service principals API.
For code examples, see the Databricks SDK for Python documentation.
You can also use curl, the Databricks CLI, or Terraform to work with service principals programmatically.