Skip to main content
This page sets up a Databricks connection that authenticates as a service principal with M2M OAuth. Datafold needs catalog-level permissions to read and write table data, stage cross-database diff transfers, query system tables and deploy migration bundles.

Before you begin

  • Workspace admin access, so you can create a service principal and grant permissions.
  • A SQL warehouse for Datafold to use.
  • The Unity Catalog catalog in scope.
  • Permission to add data connections in Datafold.
Replace <CATALOG> and <SERVICE_PRINCIPAL_ID> with your values. <SERVICE_PRINCIPAL_ID> is the application ID (Client ID) of the service principal. In Databricks SQL, service principal identifiers must be enclosed in backticks.

Set up Databricks

1

Create a service principal

  1. Go to Settings → Identity and access → Service principals.
  2. Click Add service principal and give it a name, for example datafold.
  3. Select the service principal, open the Secrets tab and click Generate secret.
  4. Save the Client ID and Secret. The secret is only shown once.
OAuth secrets are valid for up to 730 days, and a service principal can have at most 5 active secrets. Rotate the secret before it expires to avoid connection interruptions.
Datafold also supports personal access tokens (PATs), which Databricks considers legacy. See the Databricks authentication documentation.
2

Grant access to the SQL warehouse

  1. In the left sidebar, under SQL, go to SQL Warehouses and open the warehouse Datafold should use.
  2. On the Permissions tab, add the service principal and grant Can Use.
  3. On the Connection Details tab, copy the Server hostname and HTTP path. You need them when you add the connection in Datafold.
3

Grant access to your data

If Datafold delivers a migration on this connection, also let it create schemas. Datafold deploys migrated code into new schemas. Data diffing does not need this grant.
For migrations, a service principal using M2M OAuth needs no extra token scope. A personal access token must have the all-apis scope, because bundle deployment uploads files through the Databricks workspace-files API, which Databricks gates on all-apis even when narrower scopes are present.
4

Create a temporary schema

Datafold writes scratch tables to this schema so that data processing stays in your workspace.
5

Check the grants

Run these queries to check that the permissions are in place:
To check volume creation in the temporary schema, run this as the service principal:

Network access

If your workspace only accepts connections from allowlisted IP addresses or is only reachable over a private network, see Securing connections for the options Datafold supports. If your workspace storage account is firewalled to block public access, see Securing connections: Connect to Databricks. Datafold downloads query results over 1 MB directly from workspace storage through Cloud Fetch, which typically requires its own private endpoint in addition to the SQL warehouse connection.

Add the connection in Datafold

Go to Settings → Integrations → Data Connections, click Add new integration and choose Databricks. To authenticate with Microsoft Entra ID instead, select Azure Entra ID (Service Principal) as the Authentication method and fill in Azure Tenant ID, Azure Client ID, Azure Client Secret and Azure Scope (default 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default). Click Save.

Databricks AI for migrations

This section applies only if Datafold runs LLM inference for your migration on your Databricks model serving endpoints. Skip it for data diffing, and for migrations that use a different LLM provider. Databricks-served inference reuses the data connection above. You don’t create a second service principal, endpoint URL or API key. You do need to arrange two things in Databricks.

Grant Can Query on the serving endpoints

Serving endpoint access is a separate permission from SQL warehouse and Unity Catalog access, so the grants above do not cover it. For each endpoint you approve for inference:
  1. In the left sidebar, under Machine Learning, go to Serving.
  2. Open the endpoint and click its Permissions tab.
  3. Add the Datafold service principal and grant Can Query.
Inference requires the connection to authenticate as a service principal: M2M OAuth, a Personal Access Token, or Azure Entra ID.
If your workspace serves pay-per-token foundation models as Unity Catalog model services (system.ai.*), Datafold lists them from the Unity Catalog model services API. If the service principal cannot read that API, those models are missing from the model picker. Endpoints that are already configured keep serving inference.

Raise the AI Gateway throughput limit

The default AI Gateway limit is roughly 200,000 input tokens per minute, which heavily throttles a real migration. Ask your Databricks account team to raise it for the models you approve. Request at least 2 to 3 million input tokens per minute. Tier 2 allows up to 10 million.
Raising the limit is free: the default is a guardrail, not a paid tier. Databricks typically takes a few days to apply the change, so request it early.
When Can Query is granted and the limit is raised, connect the endpoints in Datafold by adding the Databricks LLM provider.