Databricks agent
Target Databricks
Prerequisites
To have Gluesync writing into your Databricks workspace you will need:
-
A workspace with Unity Catalog, reachable over HTTPS (port 443) from Core Hub;
-
A SQL warehouse. Serverless warehouses start on the first statement;
-
A Unity Catalog catalog, with the schemas the entities are written to. Gluesync creates tables, not schemas;
-
An identity Gluesync signs in as, with the access listed in Access the identity needs. Choose one of the supported authentication methods: a service principal with an OAuth secret (recommended), a personal access token, or, NEW, OAuth token federation, which needs no Databricks secret, or, NEW and on Azure Databricks only, a Microsoft Entra ID service principal, or, NEW, the sign-in of a user with OAuth U2M, for interactive, development and proof-of-concept use;
-
A workspace admin, or an account admin, to create that identity and grant it access. For the sign-in of a user, an account admin creates the custom OAuth app connection.
Authentication
Gluesync calls the Databricks REST API of the workspace (SQL Statement Execution, SQL warehouses and, for bulk snapshots, Files) with a bearer token. The Authentication mode field selects how that token is obtained:
| Method | Authentication mode | How Gluesync gets the token |
|---|---|---|
OAuth machine-to-machine (M2M) with a service principal (recommended) |
|
Requests an access token from the workspace with the client ID and the OAuth secret, caches it until shortly before it expires, and requests a new one when Databricks rejects it. |
|
Sends the token you paste as it is. Gluesync does not renew it: when it expires or is revoked, replace it. |
|
|
Reads a JWT from a file, an environment variable or your identity provider, exchanges it at the workspace for an access token that a federation policy allows, and exchanges again before that token expires. No Databricks secret is stored in Gluesync. |
|
Microsoft Entra ID service principal (NEW) (Azure Databricks only) |
|
Requests an access token for the Azure Databricks resource from Microsoft Entra ID with the application (client) ID and the client secret of an Entra service principal, caches it until shortly before it expires, and requests a new one when Databricks rejects it. |
|
A user signs in to Databricks from Core Hub in the browser, with the authorization code grant and PKCE, and the pipelines run as that user. Core Hub holds the refresh token, encrypted, and hands its access tokens to the agents. For interactive, development and proof-of-concept use. |
All the methods end at the same place: the identity needs the access described in Access the identity needs, and Test and continue checks the connection as described in Verify the connection.
OAuth M2M with a service principal (recommended)
A service principal is an identity for automation. Its OAuth secret is not tied to a person, so the pipeline keeps working when people change role. Gluesync requests the token from <workspace URL>/oidc/v1/token with the client credentials grant and the all-apis scope.
Prerequisites
-
A workspace admin, or an account admin, to create the service principal and its secret;
-
Permission to grant privileges on the catalog, schemas and volume, as the owner of the object or with
MANAGEon it, or as a metastore admin.
Create the service principal and its secret in Databricks
-
Create the service principal and add it to the workspace. As a workspace admin, click your username in the top bar, select Settings, open the Identity and access tab, select Manage next to Service principals, select Add service principal and choose an existing one, or select Add new, enter a name and select Add. Select the entitlements for it, and include Databricks SQL access, which covers SQL warehouses. As an account admin you can instead create it under User management in the account console and assign it to the workspace under Workspaces → your workspace → Permissions → Add permissions. See Manage service principals and Manage entitlements.
-
Generate an OAuth secret. In Settings → Identity and access → Service principals → Manage, select the service principal, open the Secrets tab and select Generate secret. Set the lifetime in days (the maximum is 730) and leave the scopes at all APIs: Gluesync requests the
all-apisscope, and a token cannot exceed the scopes of its secret. Select Generate. -
Copy the secret and the client ID. Databricks shows the secret only once. The client ID is the application ID of the service principal. See Authenticate access to Databricks with a service principal using OAuth (M2M).
-
Grant the service principal the access in Access the identity needs. In the statements, write it as its application ID between backticks:
GRANT USE CATALOG ON CATALOG main TO `<application-id>`;
Enter the values in Gluesync
| Field | Value |
|---|---|
Workspace URL (https://…) |
|
Authentication mode |
|
Service principal client ID |
The client ID (application ID) of the service principal. |
Client secret or personal access token |
The OAuth secret. |
SQL warehouse ID, Unity Catalog catalog |
As described in Setup via Web UI. |
Select Test and continue and check the result as described in Verify the connection.
Rotate the secret. A secret expires at the end of the lifetime you gave it, and a service principal can hold up to five. Generate a new secret before the old one expires, enter it in Client secret or personal access token, test the connection and then delete the old secret in Databricks.
Personal access token (PAT)
A PAT is a token a person, or a service principal, generates in the workspace. It is the shortest path to a first test. Use it for a proof of concept: the token belongs to its creator, expires on a date, and stops working if that person loses access.
Prerequisites
-
Personal access token authentication enabled in the workspace: a workspace admin turns it on under the Advanced tab of the admin settings, with the Personal Access Tokens toggle, and it is enabled by default;
-
Permission to create tokens, which a workspace admin controls (Manage personal access tokens);
-
Permission to grant privileges on the catalog, schemas and volume, as the owner of the object or with
MANAGEon it, or as a metastore admin.
Create the token in Databricks
-
Sign in to the workspace as the user the token is for. Click your username in the top bar, select Settings, then Developer, select Manage next to Access tokens and then Generate new token.
-
Enter a name and set the lifetime in days. If the dialog asks for scopes, choose Other APIs and select the scopes for the calls the agent makes:
sqlfor the SQL Statement Execution API and the SQL warehouses API, andfilesfor the Files API that bulk snapshots use. See API scopes. -
Select Generate, copy the token and select Done. See Authenticate access to Databricks with a personal access token.
-
Grant the user the access in Access the identity needs. In the statements, write it as the user name between backticks, or grant the access to a group the user belongs to:
GRANT USE CATALOG ON CATALOG main TO `data.engineer@example.com`;
To use a token that belongs to a service principal instead, a workspace admin creates the first one on its behalf with databricks token-management create-obo-token <application-id>. Prefer OAuth M2M for that case, because Gluesync renews its token on its own.
Enter the values in Gluesync
| Field | Value |
|---|---|
Workspace URL (https://…) |
|
Authentication mode |
|
Service principal client ID |
Leave it empty. |
Client secret or personal access token |
The personal access token. |
SQL warehouse ID, Unity Catalog catalog |
As described in Setup via Web UI. |
Select Test and continue and check the result as described in Verify the connection.
Rotate the token. Databricks revokes a token that is unused for 90 days and a token stops at the end of its lifetime. Generate a new token before that, enter it in Client secret or personal access token, test the connection and then revoke the old token.
OAuth token federation (NEW)
With token federation Core Hub proves who it is with a JWT that your identity provider issues, and exchanges it for a short-lived workspace token (RFC 8693 token exchange). No Databricks secret is stored in Gluesync: there is no OAuth secret to generate and rotate, and no personal access token to leak. The workspace accepts the JWT only when a federation policy matches its issuer, audience and subject. Gluesync posts the exchange to <workspace URL>/oidc/v1/token with the all-apis scope, caches the workspace token until shortly before it expires, and exchanges again when it is needed. Databricks bases the lifetime of the workspace token on the lifetime of the JWT, so a JWT that is renewed by its issuer keeps the pipeline signed in.
Prefer it when the workload that runs Core Hub already has an identity: a Kubernetes service account, a CI/CD platform, or an OpenID Connect identity provider that can issue tokens to a client. Databricks recommends workload identity federation wherever it is possible. See Authenticate access to Databricks using OAuth token federation.
Prerequisites
-
An account admin, to create the federation policy in the Databricks account console (Configure a federation policy);
-
A workspace admin, or an account admin, to add the service principal to the workspace when you use a service principal federation policy;
-
A source of JWTs that Core Hub can read, one of the three in [databricks-federation-sources]. The JWT must be signed with RS256 or ES256, and it must not have expired when Core Hub uses it;
-
An issuer whose public keys Databricks can read. Unless the policy carries the keys itself, Databricks fetches them from
<issuer URL>/.well-known/openid-configuration, which must contain ajwks_uri; -
Permission to grant privileges on the catalog, schemas and volume, as the owner of the object or with
MANAGEon it, or as a metastore admin.
Create the federation policy in Databricks
-
Read the claims of the JWT Core Hub will present: the issuer (
iss), the audience (aud) and the subject (sub). Decode the payload, which is the second dot-separated segment of the token, on your own machine and never on a website: a JWT is a credential until it expires. If a Gluesync connection check fails, its message lists the same three claims, see Troubleshooting authentication and access. -
Choose the kind of policy. Both kinds are created by an account admin. Use a service principal federation policy when Gluesync should sign in as one service principal that you name.
Policy What it does Service principal client ID in Gluesync Service principal federation policy
Attached to one service principal: a JWT that matches the policy signs in as that service principal. The grants go to one identity that you name.
The application ID (client ID) of the service principal.
Account federation policy
Applies to every user and service principal of the account. The claim named by the policy’s Subject claim holds the Databricks user name of the identity that signs in.
Empty. Gluesync then sends no
client_idin the exchange. -
Create the policy in the account console. For a service principal federation policy, click User management, open the Service principals tab, select the service principal, open the Credentials & secrets tab, and under Federation policies click Create policy. For an account federation policy, click Security, open the Identity provider setup tab, and under Federation policies click Create policy. Choose the federated credential provider, or enter the values yourself: the Issuer (an
https://URL, matched againstiss), the Audiences (matched againstaud, and at least one must match; the default is your Databricks account ID) and the Subject (matched against the claim in Subject claim,subby default). If the issuer does not publish its keys at<issuer URL>/.well-known/openid-configuration, add them in JWKS JSON, or give a JWKS URI. Click Create policy.You can create the same policy with the Databricks CLI, signed in to the account with
databricks auth login --host https://accounts.cloud.databricks.com --account-id <account-id>. For a service principal federation policy:databricks account service-principal-federation-policy create <service-principal-numeric-id> --json '{ "oidc_policy": { "issuer": "<issuer>", "audiences": ["<audience>"], "subject": "<subject>" } }'For an account federation policy, with
subject_claimnaming the claim that holds the Databricks user name:databricks account federation-policy create --json '{ "oidc_policy": { "issuer": "<issuer>", "audiences": ["<audience>"], "subject_claim": "sub" } }' -
For a service principal federation policy, add the service principal to the workspace, as in the first step of OAuth M2M with a service principal (recommended), with the Databricks SQL access entitlement. The exchange fails for a service principal that is not in the workspace. You do not generate an OAuth secret: the policy replaces it.
-
Grant the identity the access in Access the identity needs. In the statements, write the service principal as its application ID between backticks.
Databricks allows up to 20 policies for each service principal and 20 account federation policies for each account. Register only identity providers that your organization manages and trusts.
Policy values for common workloads
The issuer, audience and subject always come from the JWT you use. These are the values Databricks documents for platforms that issue workload tokens. Whatever the platform, the JWT must reach Core Hub through one of the sources in [databricks-federation-sources].
| Platform | Issuer and audience | Subject |
|---|---|---|
Kubernetes |
The issuer is the service account issuer of the cluster ( |
|
GitHub Actions |
Issuer |
|
GitLab CI/CD |
The issuer is the GitLab instance that issues the job token. The audience is the |
|
Azure DevOps Pipelines |
Issuer |
|
Enter the values in Gluesync
Gluesync reads the JWT from the Federated token source you select. The form shows only the fields of the selected source.
| Field | Value |
|---|---|
Workspace URL (https://…) |
|
Authentication mode |
|
Service principal client ID |
The application ID of the service principal for a service principal federation policy. Leave it empty for an account federation policy. |
Federated token source |
|
SQL warehouse ID, Unity Catalog catalog |
As described in Setup via Web UI. |
The Client secret or personal access token field is not used with token federation.
File (FILE). The JWT is in a file that Core Hub can read.
| Field | Value |
|---|---|
Federated JWT file path |
The path of the file as the Core Hub process sees it, for example |
Gluesync reads the file on every exchange, so a token that is renewed in place is picked up without a restart. This is the way to use a Kubernetes projected service account token, which Kubernetes refreshes: mount it in the Core Hub container and set the audience to the one in the policy.
spec:
containers:
- name: core-hub
volumeMounts:
- name: databricks-token
mountPath: /var/run/secrets/databricks
readOnly: true
volumes:
- name: databricks-token
projected:
sources:
- serviceAccountToken:
path: token
audience: <audience in the federation policy>
expirationSeconds: 3600
Environment variable (ENVIRONMENT_VARIABLE). The JWT is in a variable of the Core Hub process.
| Field | Value |
|---|---|
Federated JWT environment variable |
The name of the variable, for example |
Gluesync reads the variable on every exchange. The variable of a running process changes only when the process is started again, so use a file for a token that is renewed while Core Hub runs.
Identity provider client credentials (IDP_CLIENT_CREDENTIALS). Gluesync asks your OpenID Connect identity provider for a JWT with the client credentials grant, and exchanges it. Use it when no platform writes a token for you and the identity provider can issue tokens to a client of its own.
| Field | Value |
|---|---|
Identity provider token URL (https://…) |
The token endpoint of the identity provider. It must start with |
Identity provider client ID |
The client ID of the client you registered for Core Hub in the identity provider. |
Identity provider client secret |
The secret of that client. It is the only secret of this method, and Core Hub hides it when it shows the configuration. |
Identity provider scope |
Optional. Sent as |
Identity provider audience |
Optional. Sent as |
Gluesync sends grant_type=client_credentials, the client ID and the client secret as form fields to the token URL, and uses the access_token of the answer (the id_token when there is no access token). It must be a JWT whose issuer, audience and subject match the policy. Gluesync asks for a new JWT on every exchange and keeps none; it keeps the workspace token that the exchange returns.
Select Test and continue and check the result as described in Verify the connection.
Microsoft Entra ID service principal (NEW)
On Azure Databricks the identity can be a Microsoft Entra ID service principal: an application you register in Microsoft Entra ID, whose client secret Gluesync exchanges for a Microsoft Entra access token for Azure Databricks. Gluesync posts the client credentials grant to <authority host>/<tenant ID>/oauth2/v2.0/token with the scope 2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default, the identifier of the Azure Databricks resource, which is the same in every Azure cloud. It caches the token until shortly before it expires, and requests a new one when Databricks rejects it. The workspace accepts the token only for a service principal that was added to it.
Databricks recommends OAuth M2M with an Azure Databricks managed service principal for automation that talks to Azure Databricks only, and Microsoft Entra ID managed service principals for cases where one identity has to authenticate with Azure Databricks and with other Azure resources. See Service principals and Authenticate with Microsoft Entra service principals.
Prerequisites
-
An Azure Databricks workspace. The method is not available for Databricks on other clouds;
-
Permission to register applications in your Microsoft Entra tenant and to create a client secret for the application;
-
A workspace admin, or an account admin, to add the service principal to the workspace;
-
Core Hub able to reach the Microsoft Entra authority host over HTTPS,
login.microsoftonline.comunless the tenant is in a national cloud, besides the workspace; -
Permission to grant privileges on the catalog, schemas and volume, as the owner of the object or with
MANAGEon it, or as a metastore admin.
Register the application in Microsoft Entra ID
-
Sign in to the Azure portal, switch to the tenant of the workspace with Directories + subscriptions if needed, and search for and select Microsoft Entra ID.
-
Select Add → App registration, enter a Name, select Accounts in this organizational directory only (Single tenant) and select Register.
-
On the Overview page, copy the Application (client) ID and the Directory (tenant) ID. Gluesync needs both.
-
Open Certificates & secrets → Client secrets → New client secret, enter a description, set the expiry period and select Add. Copy the secret Value and store it securely. The Secret ID is not the secret. See Get Microsoft Entra ID tokens manually: Get tokens for service principals.
| Tenants in the Azure Government and the Microsoft Azure operated by 21Vianet clouds use their own Azure portal and their own Microsoft Entra authority host, see the Microsoft Entra authority host field below and Microsoft Entra authentication and national clouds. |
Add the service principal to the Azure Databricks workspace
-
As a workspace admin, sign in to the workspace, click your username in the top bar, select Settings, open the Identity and access tab, select Manage next to Service principals and select Add service principal. Select Add new, select Microsoft Entra ID managed, paste the application (client) ID, enter a name and select Add. Then select the entitlements for the service principal, and include Databricks SQL access, which covers SQL warehouses. As an account admin you can instead create it under User management in the account console, with Management set to Microsoft Entra ID managed and the Microsoft Entra application ID filled in, and assign it to the workspace under Workspaces → your workspace → Permissions → Add permissions. See Manage service principals.
-
Grant the service principal the access in Access the identity needs, including
CAN USEon the SQL warehouse. In the statements, write it as its application ID between backticks:GRANT USE CATALOG ON CATALOG main TO `<application-id>`;
Enter the values in Gluesync
| Field | Value |
|---|---|
Workspace URL (https://…) |
|
Authentication mode |
|
Service principal client ID |
The Application (client) ID of the app registration, a GUID. |
Client secret or personal access token |
The client secret Value, not the Secret ID. |
Microsoft Entra tenant ID |
The Directory (tenant) ID of the tenant that holds the app registration: a GUID, or a verified domain name such as |
Microsoft Entra authority host (https://…) |
The sign-in host of the cloud the tenant is in, |
SQL warehouse ID, Unity Catalog catalog |
As described in Setup via Web UI. |
Select Test and continue and check the result as described in Verify the connection.
Rotate the secret. A client secret expires at the end of the expiry period you gave it. Create a new secret for the app registration before the old one expires, enter its value in Client secret or personal access token, test the connection and then delete the old secret in the Azure portal. A new value makes Gluesync request a new token.
User sign-in with OAuth U2M (NEW)
With user-to-machine (U2M) OAuth a person signs in to Databricks from Core Hub in their browser, and the pipelines that use the connection run as that person. Core Hub signs the user in with the OAuth authorization code grant and PKCE against the OIDC endpoints of the workspace, <workspace URL>/oidc/v1/authorize and <workspace URL>/oidc/v1/token, with the scopes all-apis and offline_access. Core Hub keeps the refresh token of the sign-in, encrypted in its own storage, and keeps the access tokens in memory only. Every agent that uses the connection gets its access tokens from Core Hub, which renews them for all of them at once. The agent never holds a refresh token, and no Databricks secret of the user is typed into Gluesync.
Use it when the pipeline should act with the identity and the permissions of a person: interactive work, development and a proof of concept, where the grants of that person decide what the pipeline can read and write. Prefer OAuth M2M or OAuth token federation for a pipeline in production: their identity is not tied to a person, and they do not need anyone to sign in again. See Authorize user access to Databricks with OAuth (U2M).
A sign-in belongs to a connection, not to a pipeline. Every pipeline whose agent uses the connection runs as the user who signed in to it, so sign in to a connection that is dedicated to this purpose.
Prerequisites
-
An account admin, to create the custom OAuth app connection in the Databricks account console. The client IDs that Databricks publishes for its own tools, such as
databricks-cli, are meant for those tools: the manual U2M flow in the Databricks documentation useshttp://localhost:8020as the redirect address, and Core Hub needs its own. Databricks states that, when you do not use one of its built-in tools, you must enable a custom OAuth application and use its client ID (Enable or disable partner OAuth applications); -
A Core Hub that the browser reaches over HTTPS. Core Hub accepts a plain
http://address for the sign-in only onlocalhostor127.0.0.1; -
A Core Hub user who can manage connections (
SUPER_ADMINorMANAGER) to sign in, disconnect and edit the connection; -
A Databricks user with the access listed in Access the identity needs, written in the statements as the user name between backticks, or granted to a group the user belongs to;
-
A browser that lets Core Hub open a pop-up window. The sign-in runs in it.
Create the app connection in Databricks
-
Copy the redirect URL from Gluesync. In Gluesync, create the connection, or open it, and set Authentication mode to
U2M. The Databricks account control shows the redirect URL with a copy button,https://<core-hub-host>/connections/oauth/callback, built from the address your browser uses to reach Core Hub. If people reach Core Hub under more than one address, register the redirect URL of each of them. -
As an account admin, sign in to the account console and click the Settings icon in the sidebar. On the App connections tab, click Add connection.
-
Enter a name, and paste the redirect URL in the redirect URLs of the connection.
-
In Access scopes, select All APIs. The
openid,email,profileandoffline_accessscopes are allowed automatically, andoffline_accessis the one that makes Databricks issue a refresh token: without it the sign-in fails because Databricks returns no refresh token. -
Set the token lifetimes, see [databricks-u2m-ttl]. The access token TTL, in minutes, defaults to 60, and the refresh token TTL, in minutes, defaults to 10080, which is 7 days.
-
Choose the kind of client. A confidential client has a client secret: turn on Generate a client secret. A public client has none. Gluesync supports both.
-
Create the connection. The Connection created dialog shows the client ID and, for a confidential client, the client secret. Copy them: Databricks does not show the secret again. See Enable or disable partner OAuth applications and, on Azure Databricks, Enable or disable partner OAuth applications, which describe the same steps for a custom application.
A change to the redirect URLs or to a TTL of an existing app connection is made by opening it from Settings → App connections, and Databricks says that it can take about 30 minutes to apply.
Choose the refresh token lifetime
A refresh token stops working when its lifetime ends, and the pipeline then needs a new sign-in. With the default of 10080 minutes, that is every 7 days. Choose one of these:
-
Raise the refresh token TTL of the app connection. The API accepts values from 5 to 129600 minutes, which is 90 days. See the Create custom OAuth app integration reference;
-
Enable single-use refresh tokens, also known as refresh token rotation. Each time Core Hub uses a refresh token, Databricks issues a new one with a renewed lifetime and invalidates the old one, so a session lasts for as long as the connection is used, up to the absolute session lifetime that you set. Core Hub also renews a sign-in that nothing has used for a day. Databricks lists the option as Beta in its API reference, and configures it through the API or the CLI only, with
enable_single_use_refresh_tokensandabsolute_session_lifetime_in_minutesundertoken_access_policy, see Single-use refresh tokens.
databricks account custom-app-integration update <app_integration_id> --json '{
"token_access_policy": {
"access_token_ttl_in_minutes": 60,
"refresh_token_ttl_in_minutes": 1440,
"enable_single_use_refresh_tokens": true,
"absolute_session_lifetime_in_minutes": 43200
}
}'
When the refresh token is refused, Core Hub marks the sign-in as requiring re-authentication, raises a warning notification titled Re-authentication required that lists the pipelines that use the connection, and the agents fail with Re-authentication Required until a user signs in again, see Troubleshooting authentication and access.
Enter the values in Gluesync
| Field | Value |
|---|---|
Workspace URL (https://…) |
|
Authentication mode |
|
OAuth client ID of the app connection |
The client ID of the app connection. Required. |
OAuth client secret of the app connection |
The client secret of a confidential app connection. Leave it empty for a public one. Core Hub returns |
SQL warehouse ID, Unity Catalog catalog |
As described in Setup via Web UI. |
Sign in
The sign-in needs a saved connection, because it belongs to the connection. In a form that is not saved yet, Gluesync saves the connection first.
-
In Databricks account, select Sign in with Databricks. A window opens on the sign-in page of your workspace.
-
Sign in to Databricks as the user the pipelines should run as, and approve the access that the app connection asks for.
-
The window closes and the control shows Signed in as the display name of the user, or their email when Databricks has no display name for them. Core Hub reads it from the SCIM
Meendpoint of the workspace with the new token, and the sign-in works without it when it cannot be read.
The sign-in must be completed within 10 minutes and in the Core Hub session that started it, and it can be completed once. If the window is closed first, or another user’s session answers, select Sign in with Databricks again. Select Test and continue and check the result as described in Verify the connection.
Status of the sign-in
| Status | Meaning |
|---|---|
|
Nobody has signed in to this connection, or the sign-in was removed. The control offers Sign in with Databricks. The agents fail with |
|
A user is signed in. The control shows Signed in as, with Disconnect and Sign in again, and the pipelines on the connection run as that user. |
|
Databricks refused the refresh token for good: it expired, it was spent, or the consent or the app connection was removed. The control shows Re-authentication required and Sign in again. The agents fail with |
A sign-in is the grant of one user to one app connection of one workspace. When the Workspace URL (https://…), the OAuth client ID of the app connection, the OAuth client secret of the app connection or the Authentication mode of the connection changes, Core Hub removes the sign-in, and a user signs in again. Deleting the connection removes it as well. A temporary error of Databricks, such as an HTTP 5xx or 429, or a network failure, does not change the status: Core Hub asks again at the next request.
Disconnect
Disconnect removes the sign-in from Core Hub: it deletes the stored refresh token and the access token that Core Hub holds. The pipelines that use the connection fail with Sign-in Required at their next token request. An agent can keep the access token it already has for up to 5 minutes. Core Hub does not stop or start any pipeline by itself: start the pipelines that stopped once a user has signed in again.
Databricks documents no endpoint to revoke an OAuth token. Core Hub asks the workspace to revoke the token only if its discovery document, <workspace URL>/oidc/.well-known/oauth-authorization-server, lists a revocation_endpoint, and a failure of that call does not stop the disconnect. As a result, the tokens Databricks already issued stay valid until they expire: an access token for its TTL, 60 minutes by default, and the refresh token for its TTL. To cut off a user at once:
-
Remove the grants of the user in Databricks, see Access the identity needs, or deactivate the user;
-
Remove the consent of the user with
DELETE /api/2.0/oauth-app-integrations/<app-integration-id>/user-consent/me, which Databricks documents as not invalidating the tokens already issued, or delete the app connection in the account console, so that Databricks issues no new tokens through it.
Backup, restore and disaster recovery
-
The tokens never leave Core Hub. They are not part of any response of the REST API, of an Automator export, including an export with Include secrets, or of a pipeline backup. The sign-in status the API returns holds no token;
-
After a restore the connection is not signed in: it has the settings of the backup and no tokens, so its status is
NOT_SIGNED_INand the agents fail withSign-in Required. Sign in again from the restored Core Hub. A backup without secrets also masks the OAuth client secret of the app connection, which must be entered again, see Backup and restore; -
A Core Hub that starts from a replica of the Core Hub database that lags behind the primary can hold a refresh token that Databricks has already replaced, when the app connection uses single-use refresh tokens. Its first refresh is then refused, the status becomes
REAUTH_REQUIRED, and a user signs in again. On installs that keep such a standby, prefer multi-use refresh tokens for the app connection.
Access of the signed-in user
The pipelines run as the user, with the permissions of that user, so the access in Access the identity needs, including CAN USE on the SQL warehouse, is granted to the user or to a group the user belongs to. When the person leaves or changes role, sign in with another user, or move the connection to OAuth M2M.
Access the identity needs
Whatever the authentication method, the identity (the service principal, or the user the token belongs to, or the user who signed in with U2M) needs the access below, and no more. The examples grant on the schema, so the privileges apply to every table in it; grant SELECT and MODIFY on individual tables to narrow them. Replace <principal> with the identity as written in the steps of its method, and <catalog> with the value of Unity Catalog catalog.
| Where | Access and what Gluesync does with it |
|---|---|
SQL warehouse |
|
Catalog |
|
Each schema the entities write to |
|
Each table Gluesync writes to |
|
Each schema where Gluesync creates tables |
|
Each table Gluesync creates, only with Publish Unity Catalog tags |
|
Staging volume, only for bulk snapshots |
|
-- Catalog and the schemas the entities write to
GRANT USE CATALOG ON CATALOG <catalog> TO `<principal>`;
GRANT USE SCHEMA, SELECT, MODIFY ON SCHEMA <catalog>.<schema> TO `<principal>`;
-- Only when Gluesync creates the tables in that schema
GRANT CREATE TABLE ON SCHEMA <catalog>.<schema> TO `<principal>`;
-- Only with "Publish Unity Catalog tags"
GRANT APPLY TAG ON SCHEMA <catalog>.<schema> TO `<principal>`;
-- Bulk snapshots, with a staging volume you created (set it in "Staging volume for bulk snapshots")
GRANT USE SCHEMA ON SCHEMA <catalog>.<staging_schema> TO `<principal>`;
GRANT READ VOLUME, WRITE VOLUME ON VOLUME <catalog>.<staging_schema>.<volume> TO `<principal>`;
-- Bulk snapshots, with the default staging volume that Gluesync creates
GRANT CREATE SCHEMA, CREATE VOLUME ON CATALOG <catalog> TO `<principal>`;
A catalog owner, a schema owner, a user with MANAGE and a metastore admin can run these statements. See Unity Catalog privileges. The staging volume rows apply only when bulk operations are enabled for a snapshot.
Verify the connection
Select Test and continue in the agent form, see Configure source and target connectors. The check proves that:
-
the workspace URL is reachable over HTTPS;
-
the credentials are valid: with
SERVICE_PRINCIPALGluesync gets an OAuth token, withPATDatabricks accepts the token, withTOKEN_FEDERATIONGluesync reads the JWT and the workspace exchanges it for an access token, which proves that the federation policy matches, withENTRA_SERVICE_PRINCIPALMicrosoft Entra issues a token for the application and the workspace accepts it, which proves that the service principal was added to the workspace, and withU2MCore Hub holds a sign-in for the connection and the workspace accepts the access token it hands out, so the check reportsSign-in Requireduntil a user has signed in; -
the SQL warehouse ID exists and the warehouse is not being deleted.
It reads the state of the warehouse without starting it, so a stopped warehouse passes the check and the first statement starts it. It does not run a query, so it cannot prove the grants in Access the identity needs: they are checked when the first statements run.
To check the grants before you start a pipeline, run queries in Query Studio on this agent: they use the same identity and warehouse as the pipeline. SELECT current_user() shows which identity Gluesync signs in as (with token federation, the service principal of the policy, and with U2M, the user who signed in), and SELECT * FROM <catalog>.<schema>.<table> LIMIT 1 on a target table needs USE CATALOG, USE SCHEMA and SELECT. Or, as a Databricks admin, run SHOW GRANTS on the catalog, schema or volume, see SHOW GRANTS.
Troubleshooting authentication and access
Gluesync reports these errors with a title, such as Authentication Failed, and a message. Databricks supplies the error code and the text after the colon.
| Message | Cause | What to do |
|---|---|---|
|
Databricks rejected the credentials. With |
Check the client ID and the secret, or generate a new secret or token. Check that the token comes from the workspace in Workspace URL (https://…). For a token, check that PAT authentication is still enabled in the workspace. |
|
The identity is known but may not call the API: no |
Grant the access in Access the identity needs, and generate a secret with all APIs, or a token with the |
|
The statement ran and Unity Catalog refused it: a missing |
Grant the privilege the message names to the identity on that object. |
|
The SQL warehouse ID does not exist in this workspace. |
Copy the last part of the HTTP path under SQL Warehouses → Connection details of the warehouse, |
|
Workspace URL (https://…) points at a host that is not the workspace, or at a path inside it. |
Use the address of the workspace only, for example |
|
The workspace host cannot be reached: a mistyped host name, or a firewall or proxy between Core Hub and the workspace. |
Check the host name, and that Core Hub can reach it over HTTPS on port 443. |
|
Workspace URL (https://…) is empty or starts with another protocol. |
Enter the full URL, starting with |
|
A required field is empty for the selected Authentication mode. |
Fill in Service principal client ID and Client secret or personal access token for |
|
Core Hub cannot read the file in Federated JWT file path: it does not exist in the Core Hub container, the process may not read it, or it is not a text file. |
Check the path as the Core Hub process sees it, for example that the volume is mounted in the Core Hub container and that the file is readable by the user Core Hub runs as. |
|
The variable in Federated JWT environment variable does not exist in the environment of the Core Hub process, or it is empty. |
Set the variable in the environment Core Hub is started with, and start Core Hub again. Check that you wrote the name of the variable and not the token. |
|
The file or the variable exists but holds nothing. |
Check what writes the token. The message names the file or the variable. |
|
What was read is not three dot-separated segments, or the payload is not base64url JSON. Typical causes: the file holds a different value, a quoted or wrapped value, or an error page. |
Check the content of the source: it has to be the JWT alone. |
|
The |
Renew the token at its source. For a rotating token use File as the token source: it is read on every exchange. Check that the clock of the Core Hub host is correct. |
|
The identity provider rejected the request of Identity provider token URL (https://…): wrong client ID or secret, a client that may not use the client credentials grant, or a Identity provider scope or Identity provider audience the provider does not accept. |
Check the client in the identity provider and the fields. The message carries the error and the description the provider sent, without the secret. |
|
The token URL answered successfully but not with a token. |
Check that Identity provider token URL (https://…) is the token endpoint of the provider. |
|
The workspace did not find a federation policy that matches the JWT: another issuer, an audience that is not in the policy, another subject, or a policy of another kind than the one in Service principal client ID. Databricks adds its own description, and a request ID that Databricks support asks for. |
Compare the three claims in the message with the Issuer, Audiences and Subject of the policy in the account console, and check that the policy kind fits: the message ends with |
|
The workspace does not know the service principal in Service principal client ID: a wrong application ID, or a service principal that is in the account but was not added to this workspace. |
Check the application ID, and add the service principal to the workspace as in OAuth token federation (NEW). |
|
The workspace answered with another status, such as a 5xx, or with something that is not a token. There is no hint about the policy in these messages. |
Check Workspace URL (https://…) and that the workspace is reachable. For a 5xx, try again later. |
|
The connection uses |
Open the connection, and select Sign in with Databricks in Databricks account, see User sign-in with OAuth U2M (NEW). After a restore of a backup, sign in again. |
|
Databricks refused the refresh token for good, with a code such as |
Select Sign in again in the connection, and start the pipelines that stopped. To sign in less often, raise the refresh token TTL of the app connection or enable single-use refresh tokens, see [databricks-u2m-ttl]. |
|
Databricks answered the renewal with a temporary error, such as an HTTP 5xx or 429, or could not be reached. The sign-in is not lost: its status does not change. |
Check that Core Hub can reach the workspace over HTTPS, and try again later. |
|
The redirect address of the sign-in does not name the host your browser used to reach Core Hub, or it is a plain |
Open Core Hub over HTTPS, at the address you registered in the app connection, and check what the proxy forwards. |
The sign-in window shows an error of Databricks about the redirect URL or the client |
The redirect URL shown by Databricks account is not among the redirect URLs of the app connection, or the client ID is not one of an app connection. Databricks writes the text of this page, not Gluesync. |
Register the redirect URL exactly as the control shows it, |
|
Databricks refused the code exchange: the client ID is wrong, the app connection is confidential and OAuth client secret of the app connection is empty or wrong, or the app connection is public and a secret is set. |
Compare the client ID and the secret with the Connection created values of the app connection. Leave the secret empty for a public client. |
|
Databricks signed the user in but issued no refresh token, so Core Hub cannot renew the sign-in. |
Check that the app connection allows the |
|
A required field of |
Fill in Workspace URL (https://…) and OAuth client ID of the app connection, and save the connection. |
|
The browser did not open the sign-in window. |
Allow pop-ups for the address of Core Hub, then select Sign in with Databricks again. |
|
A sign-in has to be completed within 10 minutes and can be completed once. The window was open for longer, the page was reloaded, or the callback was opened twice. The same message appears after a restart of Core Hub, which forgets sign-ins that are still pending. |
Select Sign in with Databricks again and complete it without waiting. |
|
Only the Core Hub user who started the sign-in can complete it, and that user has to have a valid session and the permission to manage connections. |
Sign in to Core Hub as the user who starts the sign-in, and start it again. |
|
The workspace, the client ID or the client secret changed between the start and the end of the sign-in. |
Save the connection, and start the sign-in again. |
|
The secret in Client secret or personal access token is not the client secret: typically the Secret ID was copied in place of the Value, or the value is mistyped. |
Copy the Value of the client secret in Certificates & secrets of the app registration. If it was not copied when the secret was created, create a new secret. |
|
The secret reached its expiry date. |
Create a new client secret and enter its value, see the rotation steps in Microsoft Entra ID service principal (NEW). |
|
The secret is past its expiry date, or its start date is still in the future. |
Create a new client secret, or check the clock of the Core Hub host. |
|
The application (client) ID in Service principal client ID does not belong to the tenant in Microsoft Entra tenant ID: a mistyped ID, or an app registration of another tenant. |
Compare both values with the Overview page of the app registration. |
|
Microsoft Entra tenant ID is not a directory of the cloud that Microsoft Entra authority host (https://…) names. |
Check the tenant ID. For a tenant in Azure Government or Microsoft Azure operated by 21Vianet, set the authority host of that cloud. |
|
The service principal of the application is disabled in the tenant. |
Enable it in Microsoft Entra ID, or use another application. |
|
The app registration allows public client flows, so Microsoft Entra does not accept a client secret for it. |
In the app registration, open Authentication and turn off Allow public client flows. |
|
Microsoft Entra does not find the Azure Databricks resource in the tenant, or in the cloud that the authority host names. |
Check Microsoft Entra tenant ID, and that Microsoft Entra authority host (https://…) is the one of the cloud the workspace is in. |
|
A Conditional Access policy of the tenant applies to the service principal and blocks the request. |
Ask the Microsoft Entra administrator of the tenant to review the policy for this service principal. |
|
Microsoft Entra refused the request with an error that Gluesync does not translate. The message carries the code and the first line of the description that Entra sent, never the secret. |
Look the code up in the Microsoft Entra error codes, and give the correlation ID to the Microsoft Entra administrator when you need the sign-in log entry. |
|
Microsoft Entra answered with a status that is not a client error, such as a 5xx, or with something that is not a token. |
Check Microsoft Entra authority host (https://…) and that Core Hub can reach it over HTTPS. For a 5xx, try again later. |
|
Microsoft Entra issued the token, and the workspace refused it: the service principal was not added to this workspace, was added to another one, or has no |
Add the service principal to the workspace as in Microsoft Entra ID service principal (NEW), check that Workspace URL (https://…) is that workspace, and grant |
|
Service principal client ID is empty, or is not a GUID. |
Enter the Application (client) ID of the app registration. |
|
Client secret or personal access token is empty. |
Enter the client secret Value. |
|
Microsoft Entra tenant ID is empty, or is neither a GUID nor a domain name. |
Enter the Directory (tenant) ID. |
|
Microsoft Entra authority host (https://…) is not an |
Enter the host alone, for example |
|
The field of the selected Federated token source is empty. |
Fill in the field for the source you selected. |
|
A required field of |
Fill in the three fields, with an |
|
A configuration sent with the REST API carries a value that is not one of the options. |
Use |
|
SQL warehouse ID or Unity Catalog catalog is empty. |
Fill in both fields. |
|
The warehouse was deleted, or is being deleted. |
Choose another warehouse and enter its ID. |
|
The statement ran longer than Statement timeout in seconds. A stopped warehouse that has to start first counts, because the connection check does not start it. |
Start the warehouse before the first run, or raise the timeout. Serverless warehouses start fastest. |
|
The workspace answered HTTP 503, or HTTP 429. |
Gluesync retries up to five times with backoff, following |
|
The catalog, schema or table does not exist, or the identity cannot see it. |
Check the names in Unity Catalog catalog and in the entity mapping, and the grants in Access the identity needs. |
|
Staging volume for bulk snapshots does not have three parts. |
Write it as |
Setup via Web UI
-
Protocol (
protocol):HTTPS, the only value; -
Workspace URL (https://…) (
host):https://<workspace-host>, for examplehttps://adb-1234567890123456.7.azuredatabricks.netorhttps://dbc-1a2b3c4d-5e6f.cloud.databricks.com. It must start withhttps://; -
Port (
port):443; -
Authentication mode (
authMode):SERVICE_PRINCIPAL(default) uses OAuth machine-to-machine;PATuses a personal access token;TOKEN_FEDERATION(NEW) exchanges a JWT of your identity provider;ENTRA_SERVICE_PRINCIPAL(NEW, Azure Databricks) uses a Microsoft Entra ID service principal;U2M(NEW) signs a user in to Databricks from Core Hub. See Authentication for the values each method takes. The form shows only the fields of the selected mode; -
Service principal client ID (
username): the OAuth client ID of the service principal. With token federation, the application ID of the service principal of a service principal federation policy, empty for an account federation policy. WithENTRA_SERVICE_PRINCIPAL, the application (client) ID of the Microsoft Entra app registration; -
Client secret or personal access token (
password): the OAuth secret of the service principal, or the personal access token. WithENTRA_SERVICE_PRINCIPAL, the client secret of the app registration. Not used with token federation orU2M. WithU2Mthe form hides this field and the previous one; -
SQL warehouse ID (
warehouseId): the last part of the warehouse HTTP path,/sql/1.0/warehouses/<id>, under SQL Warehouses → Connection details; -
Unity Catalog catalog (
catalog): the catalog that holds the target schemas; -
With
TOKEN_FEDERATIONonly, see OAuth token federation (NEW):-
Federated token source (
federationJwtSource):FILE(default),ENVIRONMENT_VARIABLEorIDP_CLIENT_CREDENTIALS; -
Federated JWT file path (
federationJwtFilePath): withFILE, the path of the file that holds the JWT; -
Federated JWT environment variable (
federationJwtEnvVariable): withENVIRONMENT_VARIABLE, the name of the variable of the Core Hub process; -
Identity provider token URL (https://…) (
federationIdpUrl), Identity provider client ID (federationIdpClientId) and Identity provider client secret (federationIdpClientSecret): withIDP_CLIENT_CREDENTIALS, the token endpoint and the client credentials; -
Identity provider scope (
federationIdpScope) and Identity provider audience (federationIdpAudience): optional, withIDP_CLIENT_CREDENTIALS;
-
-
With
ENTRA_SERVICE_PRINCIPALonly, see Microsoft Entra ID service principal (NEW):-
Microsoft Entra tenant ID (
entraTenantId): the directory (tenant) ID, a GUID, or a verified domain name. Required; -
Microsoft Entra authority host (https://…) (
entraAuthorityHost): defaulthttps://login.microsoftonline.com. For a national cloud,https://login.microsoftonline.usorhttps://login.partner.microsoftonline.cn;
-
-
With
U2Monly, see User sign-in with OAuth U2M (NEW):-
OAuth client ID of the app connection (
u2mClientId): the client ID of the custom OAuth app connection. Required; -
OAuth client secret of the app connection (
u2mClientSecret): the client secret of a confidential app connection, empty for a public one; -
Databricks account (
u2mSignIn): not a value. The form draws the sign-in control in its place: Sign in with Databricks, the redirect URL to register with a copy button, Signed in as, Disconnect, and the warning that re-authentication is required;
-
-
Statement timeout in seconds (
statementTimeoutSeconds): default600. A statement still running after this time is canceled on the warehouse and the write fails; -
Staging volume for bulk snapshots (catalog.schema.volume) (
stagingVolume):catalog.schema.volumeof the Unity Catalog volume bulk snapshots are staged in. Empty uses<catalog>.gluesync_staging.bulk_files, which the connector creates when missing; -
OpenLineage API secret (bearer token) (
openLineageApiSecret): optional. The bearer token sent to the OpenLineage endpoint, if it asks for one. See Lineage (NEW).
The connection check reads the state of the warehouse without starting it, so a stopped warehouse passes the check; the first statement starts it. See Verify the connection.
Specific configuration
-
Disable truncate before snapshot (
disableTruncateOnSnapshot): defaultfalse; -
Publish Unity Catalog tags (
publishUnityCatalogTags): defaultfalse. NEW: when on, Gluesync sets the Unity Catalog tagsgluesync_managedandgluesync_versionon every table it creates. See Unity Catalog metadata; -
Publish lineage to Unity Catalog (Public Preview) (
publishUnityCatalogLineage): NEW. Defaultfalse. See Lineage (NEW); -
OpenLineage endpoint URL (https://…) (
openLineageUrl): NEW. Optional. Empty, the default, sends no OpenLineage events; -
OpenLineage namespace (
openLineageNamespace): NEW. Optional, defaultgluesync.
Per entity:
-
Rows per bulk snapshot load (
bulkSnapshotFileRows): default1000000. Used only when bulk operations are enabled for the snapshot; -
Maximum rows per MERGE statement (
maxRowsPerStatement): default1000. A statement is also cut before it reaches 3,000,000 characters, well below the 16 MiB a Databricks statement may take. Raise it for large snapshots; -
SQL pre/post snapshot and CDC commands: SQL run on the warehouse around the snapshot and the CDC of the entity.
Writes
Every batch is applied as Delta MERGE statements:
-
Inserts and updates:
MERGE … WHEN MATCHED THEN UPDATE SET … WHEN NOT MATCHED THEN INSERT …. Rows are matched null-safely (<⇒) on the key they had before the change, so an update that changes the key moves the row instead of inserting a second one; -
Deletes:
MERGE … WHEN MATCHED THEN DELETE; -
Truncate, and the first snapshot batch unless Disable truncate before snapshot is set:
TRUNCATE TABLEon every table of the entity.
A Delta MERGE fails when two source rows match the same target row, and a CDC batch can change a row many times. Gluesync therefore keeps the order of the changes and cuts them into statements in which every key appears once: a later image of a row replaces the earlier one when both carry the same columns, and a key change or a different set of columns starts a new statement. The last change of a row is always the one left on the table.
Delta enforces no primary key, so an insert never fails on a duplicate: the insert conflict strategy has no effect on this target.
Rate limiting (HTTP 429), an unavailable warehouse (HTTP 502–504) and dropped connections are retried up to five times with backoff, following Retry-After. A revoked OAuth token is replaced once. Every statement the connector writes can run twice without changing the result; pre/post commands you write should be idempotent too.
Bulk snapshots
Enable bulk operations while snapshot on an entity to load its snapshot in bulk: the rows are staged in a file and loaded from a Unity Catalog volume with one MERGE per load (every Rows per bulk snapshot load rows, and at the end of the snapshot), instead of one MERGE per transaction. Gluesync confirms the staged transactions only once they are loaded, so a restart sends them again and they are written once. CDC and multi-table entities always use the per-transaction MERGE.
The identity needs READ VOLUME and WRITE VOLUME on the staging volume, or CREATE SCHEMA and CREATE VOLUME on the catalog for the connector to create the default one. Staged files are deleted after each load.
Tables Gluesync generates
CREATE TABLE IF NOT EXISTS <catalog>.<schema>.<table> (…) USING DELTA COMMENT '…' TBLPROPERTIES (…). The key columns are NOT NULL and become an informational PRIMARY KEY constraint named pk_<table>: Delta does not enforce it, but schema discovery reads it back, so the key is found again when an entity is mapped onto the table.
Unity Catalog metadata
NEW: the tables Gluesync creates are published in Unity Catalog with metadata that says they are replicated by Gluesync.
Gluesync writes:
-
Table comment:
Replicated by MOLO17 Gluesync; -
Column comments: when the source gives a column a description, it becomes the comment of that column in Databricks. A column the source does not describe has no comment;
-
Table properties:
gluesync.managed=true, andgluesync.version= the Gluesync release that created the table, for example2.3.1.1; -
Tags, only when Publish Unity Catalog tags is on:
gluesync_managed=trueandgluesync_version= the same release. Unity Catalog does not accept a dot in a tag key, so the tag keys use an underscore where the table properties use a dot.
The comment, column comments and properties are part of the CREATE TABLE IF NOT EXISTS statement. The tags are set right after the table is created.
Existing tables are left as they are
The metadata is written only to a table that Gluesync creates. A table that already exists keeps its own comment, column comments, properties and tags, whoever wrote them: Gluesync does not overwrite them, add to them or tag the table. Before it creates a table with the option on, Gluesync checks whether the table already exists; when it cannot tell, it leaves the tags unset and logs a warning.
Publish Unity Catalog tags
Turn it on in the Specific configuration of the Databricks target agent, under Publish Unity Catalog tags (publishUnityCatalogTags). It is off by default, and it applies to the tables Gluesync creates from then on: a table created while it was off is not tagged afterwards.
Setting tags takes APPLY TAG on the table, together with USE SCHEMA on its schema and USE CATALOG on its catalog. When setting the tags fails, the pipeline keeps running and the table stays created with its comment, column comments and properties: Gluesync logs a warning that names the table and these privileges.
Check the metadata
Run these in the Databricks SQL editor, or in Query Studio:
-- Table comment (the "Comment" row) and column comments
DESCRIBE TABLE EXTENDED <catalog>.<schema>.<table>;
-- gluesync.managed and gluesync.version
SHOW TBLPROPERTIES <catalog>.<schema>.<table>;
-- gluesync_managed and gluesync_version, when the tags are on
SELECT tag_name, tag_value
FROM <catalog>.information_schema.table_tags
WHERE schema_name = '<schema>' AND table_name = '<table>';
Tables you create
Any Delta table in the catalog can be a target. Schemas, tables (data_source_format = 'DELTA') and columns are read from <catalog>.information_schema; a column is a key when the table declares a PRIMARY KEY constraint on it, otherwise the key comes from the entity mapping.
Columns are mapped explicitly: a column the change carries and the table lacks fails the write with UNRESOLVED_COLUMN instead of being added.
How Gluesync identifies itself
Every request the agent sends to Databricks carries the User-Agent MOLO17_Gluesync/<version>, where <version> is the Gluesync release. Databricks uses it to attribute the traffic: the Source column of the SQL warehouse query history shows MOLO17_Gluesync, and the user_agent column of the system.access.audit system table holds the full value. To list Gluesync’s activity:
SELECT event_time, action_name, user_identity.email, user_agent
FROM system.access.audit
WHERE lower(user_agent) LIKE '%molo17_gluesync%'
AND event_time > now() - INTERVAL 2 DAYS
ORDER BY event_time DESC;
Data types
Every value is written as a literal cast to the type of its column. Timestamps have microsecond precision.
| Gluesync type | Default Databricks type | Notes |
|---|---|---|
|
|
Alternatives: |
|
|
Alternative: |
|
|
Alternative: |
|
|
Alternative: |
|
|
NaN and infinities are kept. |
|
|
Precision and scale come from the source, up to 38 digits. An unsized decimal is |
|
|
|
|
|
Alternative: |
|
|
Alternative: |
|
|
Alternatives: |
|
|
Databricks has no time-of-day type. Text |
|
|
Text |
|
|
Wall-clock time, as the source has it. Alternatives: |
|
|
Stored as an instant and shown in the session time zone. Alternative: |
|
|
The JSON text of the array. Alternatives: |
|
|
The JSON text of the map. Alternatives: |
Query Studio and data comparison
The agent is SQL-capable: Query Studio runs queries on the configured SQL warehouse and catalog, and data comparison reads the target tables through it. The same identity and warehouse as the pipeline are used.
-
Each query runs on its own through the Statement Execution API, which keeps no session between statements: there are no manual transactions and no session settings. In read-only mode a query must be a single read (
SELECT,WITH,SHOW,DESCRIBE,EXPLAIN) before it is sent. -
Names are quoted with backticks and strings escape with backslashes (
'it's'), as Databricks SQL reads them. -
Write values into the SQL: the Statement Execution API binds named markers only, so Query Studio parameters are refused.
-
Explain shows the
EXPLAINtext plan, and the DDL viewer showsSHOW CREATE TABLE. -
A cancelled query, or one that outlives its timeout, is cancelled on the warehouse too. A write is sent only once: a submission that may have reached the warehouse is not retried, except after rate limiting.
-
The Statement Execution API returns timestamps with millisecond precision, so the result grid shows milliseconds. Cast a column to
STRINGto see its microseconds. Data comparison reads timestamps as text with every microsecond, so it compares them in full.
Lineage (NEW)
Gluesync can tell your data catalog where each Delta table comes from. For every entity of a pipeline it publishes the link from the source table to the table in Unity Catalog, with the column mapping, to two destinations. Each one has its own setting and both are off by default:
-
Unity Catalog external lineage, so the source shows in the lineage graph of the Delta table in Catalog Explorer;
-
OpenLineage events, sent to an endpoint of your choice, for catalogs that read OpenLineage.
Gluesync publishes when an entity starts, once per entity for each run of the agent, whether the snapshot or the CDC starts first. An entity that reads from a query maps no table, so it has no lineage to publish. The information about the source (the agent type, host, port and database of the source connection) comes from Core Hub; credentials are never part of it.
Publishing runs in the background, with a time limit and one attempt. If it fails, for example because a privilege is missing or the endpoint does not answer, Gluesync writes one warning to the log that says what is missing, and replication carries on unaffected.
Unity Catalog (Public Preview)
Enable Publish lineage to Unity Catalog (Public Preview) in the specific configuration of the pipeline. Databricks lists the External Metadata and External Lineage APIs this option uses as Public Preview, so the feature depends on your workspace having them. Gluesync then does the following for each source table of the entity:
-
It creates an external metadata object that stands for the source table, or reuses the one it finds. The object is named
gs_<scheme>_<host>_<database>_<schema>_<table>_<hash>: the readable part is lowercased and cleaned of characters that names do not take, and the 8-character hash at the end is computed from the exact source identity, so two different tables never share an object. Itssystem_typefollows the source agent:POSTGRESQL,MICROSOFT_SQL_SERVER,ORACLE,MYSQL,SNOWFLAKE,GOOGLE_BIGQUERY,AMAZON_REDSHIFT,MONGODB,KAFKAorSAP. A source with no matching type, such as MariaDB, Db2 LUW or Cassandra, usesOTHER. The object carries the entity typetable, the names of the source columns, and properties that name the source agent, location, database, schema and table; -
It creates the lineage relationship from that object to
<catalog>.<schema>.<table>of the Delta table, with the mapping of each source column to its target column and properties that name the pipeline and the entity.
Both steps look first and create only what is missing, so running the same entity again creates nothing new.
Required privileges
The identity of the agent needs, on top of the prerequisites above:
-
CREATE EXTERNAL METADATAon the metastore, to create the external metadata objects; -
MODIFYon each external metadata object, to link it to a table; -
MODIFYon the target table, which the identity already has to write to it.
GRANT CREATE EXTERNAL METADATA ON METASTORE TO `gluesync-service-principal`;
GRANT MODIFY ON EXTERNAL METADATA `<external-metadata-object-name>` TO `gluesync-service-principal`;
GRANT MODIFY ON TABLE <catalog>.<schema>.<table> TO `gluesync-service-principal`;
When a privilege is missing, the warning in the log names it.
Where to see it
Open the Delta table in Catalog Explorer and go to the Lineage tab: the source table shows upstream of it, and the external metadata objects are listed under Catalog > External data > External Metadata. The relationships can also be listed with the External Lineage API, GET /api/2.0/lineage-tracking/external-lineage, with object_info.table.name=<catalog>.<schema>.<table> and lineage_direction=UPSTREAM.
Databricks records external lineage apart from the lineage it captures itself: it does not appear in system.access.table_lineage or system.access.column_lineage. A metastore holds up to 10,000 external metadata objects and 100,000 external lineage relationships. See the Databricks documentation on external lineage.
OpenLineage
Databricks does not read OpenLineage events, so this option is for the catalogs that do, such as Marquez. Set:
-
OpenLineage endpoint URL (https://…) (
openLineageUrl): where the events are posted. It must start withhttps://;http://is accepted forlocalhostonly, and the URL must not contain credentials. An address with no path, such as a Marquez server, takes the standard path/api/v1/lineage. Empty sends nothing; -
OpenLineage API secret (bearer token) (
openLineageApiSecret): optional, in the connection credentials. When set, it is sent as anAuthorization: Bearerheader and is never written to the log; -
OpenLineage namespace (
openLineageNamespace): the namespace of the job. Defaultgluesync.
Gluesync sends OpenLineage run events:
-
START, when the entity starts; -
COMPLETE, when the snapshot of the entity completes. The CDC of an entity runs without end, so a run that has only CDC sendsSTARTalone.
Both events of a run share one run id and reach the endpoint in order. The job is named <pipeline name>.<entity name>, with the jobType facet (BATCH for a run that starts with the snapshot, STREAMING for one that starts with the CDC). The events follow the OpenLineage dataset naming:
| Dataset | Namespace | Name |
|---|---|---|
Input: the source table |
|
|
Output: the Delta table |
|
|
Every input and output carries the schema facet with its columns and types, and every output the columnLineage facet that says which source columns feed each target column. Gluesync makes one attempt per event and gives it up after 15 seconds; an answer other than success logs a warning that names the HTTP status.
Setup via Rest APIs
Here following an example of calling the Core Hub’s Rest API via curl to setup the connection for this Agent.
Connect the agent
curl --location --request PUT 'http://core-hub-ip-address/pipelines/{pipelineId}/agents/{agentId}/config/credentials' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"hostCredentials": {
"connectionName": "myAgentNickName",
"host": "https://dbc-1a2b3c4d-5e6f.cloud.databricks.com",
"port": 443,
"username": "",
"password": "",
"maxConnectionsCount": 1,
"enableTls": true
},
"customHostCredentials": {
"authMode": "SERVICE_PRINCIPAL",
"warehouseId": "1a2b3c4d5e6f7a8b",
"catalog": "main",
"statementTimeoutSeconds": 600,
"stagingVolume": "",
"openLineageApiSecret": ""
}
}'
authMode is SERVICE_PRINCIPAL, PAT or, NEW, TOKEN_FEDERATION, ENTRA_SERVICE_PRINCIPAL or U2M. With SERVICE_PRINCIPAL, username is the client ID and password the OAuth secret; with PAT, password is the personal access token. port is 443, statementTimeoutSeconds defaults to 600, and an empty stagingVolume uses <catalog>.gluesync_staging.bulk_files. openLineageApiSecret is optional: set it only when the OpenLineage endpoint needs a bearer token. The lineage options themselves, publishUnityCatalogLineage, openLineageUrl and openLineageNamespace, are in the specific configuration of the pipeline.
Connect the agent with OAuth token federation (NEW)
With authMode set to TOKEN_FEDERATION, password is not used. username is the application ID of the service principal of a service principal federation policy, and empty for an account federation policy. These keys of customHostCredentials select where the JWT comes from:
| Key | Value |
|---|---|
|
|
|
With |
|
With |
|
With |
|
With |
The keys of the sources you do not use can be left out. This example reads the JWT from a file that Kubernetes keeps up to date, with a service principal federation policy:
curl --location --request PUT 'http://core-hub-ip-address/pipelines/{pipelineId}/agents/{agentId}/config/credentials' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"hostCredentials": {
"connectionName": "myAgentNickName",
"host": "https://dbc-1a2b3c4d-5e6f.cloud.databricks.com",
"port": 443,
"username": "<service-principal-application-id>",
"password": "",
"maxConnectionsCount": 1,
"enableTls": true
},
"customHostCredentials": {
"authMode": "TOKEN_FEDERATION",
"warehouseId": "1a2b3c4d5e6f7a8b",
"catalog": "main",
"statementTimeoutSeconds": 600,
"stagingVolume": "",
"federationJwtSource": "FILE",
"federationJwtFilePath": "/var/run/secrets/databricks/token"
}
}'
For an identity provider, set "federationJwtSource": "IDP_CLIENT_CREDENTIALS" and replace the file path with the federationIdp… keys.
Connect the agent with a Microsoft Entra ID service principal (NEW)
With authMode set to ENTRA_SERVICE_PRINCIPAL, username is the application (client) ID of the Microsoft Entra app registration and password is its client secret. These keys of customHostCredentials say where Microsoft Entra is asked for the token:
| Key | Value |
|---|---|
|
The directory (tenant) ID, a GUID, or a verified domain name such as |
|
The |
curl --location --request PUT 'http://core-hub-ip-address/pipelines/{pipelineId}/agents/{agentId}/config/credentials' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"hostCredentials": {
"connectionName": "myAgentNickName",
"host": "https://adb-1234567890123456.7.azuredatabricks.net",
"port": 443,
"username": "<application-client-id>",
"password": "<client-secret-value>",
"maxConnectionsCount": 1,
"enableTls": true
},
"customHostCredentials": {
"authMode": "ENTRA_SERVICE_PRINCIPAL",
"warehouseId": "1a2b3c4d5e6f7a8b",
"catalog": "main",
"statementTimeoutSeconds": 600,
"stagingVolume": "",
"entraTenantId": "<directory-tenant-id>",
"entraAuthorityHost": "https://login.microsoftonline.com"
}
}'
Connect the agent with a user sign-in, OAuth U2M (NEW)
A sign-in belongs to a connection, so with authMode set to U2M you create a connection, sign in to it, and attach it to the agent. username and password are not used. These keys of customHostCredentials name the app connection:
| Key | Value |
|---|---|
|
The client ID of the custom OAuth app connection. Required. |
|
The client secret of a confidential app connection. Leave it out for a public one. Core Hub returns |
-
Create the connection with the permission to manage connections:
curl --location --request POST 'http://core-hub-ip-address/connections' \ --header 'Content-Type: application/json' \ --header 'Authorization: ••••••' \ --data '{ "name": "databricks-alice", "agentTag": "databricks", "hostCredentials": { "connectionName": "databricks-alice", "host": "https://dbc-1a2b3c4d-5e6f.cloud.databricks.com", "port": 443, "username": "", "password": "", "maxConnectionsCount": 1, "enableTls": true }, "customHostCredentials": { "authMode": "U2M", "warehouseId": "1a2b3c4d5e6f7a8b", "catalog": "main", "statementTimeoutSeconds": 600, "stagingVolume": "", "u2mClientId": "<app-connection-client-id>", "u2mClientSecret": "" } }' -
Sign in to it. The sign-in needs a browser, so a script starts it and hands the address to a person. The routes are below.
POST /connections/{connectionId}/oauth/starttakes the callback of Core Hub as the browser reaches it, and answers the address to open:curl --location --request POST 'https://core-hub-host/connections/{connectionId}/oauth/start' \ --header 'Content-Type: application/json' \ --header 'Authorization: ••••••' \ --data '{ "redirectUri": "https://core-hub-host/connections/oauth/callback" }'The answer is
{"authorizationUrl": "https://dbc-1a2b3c4d-5e6f.cloud.databricks.com/oidc/v1/authorize?…"}. The person opens it in the browser in which they are signed in to Core Hub, signs in to Databricks, and Databricks sends the browser back toredirectUri. The callback has to be completed by the Core Hub user who started the sign-in. -
Attach the connection to the agent:
curl --location --request PUT 'http://core-hub-ip-address/pipelines/{pipelineId}/agents/{agentId}/config/connection' \ --header 'Content-Type: application/json' \ --header 'Authorization: ••••••' \ --data '{ "connectionId": "<connection-id>" }'
The sign-in has four routes under the connections routes:
| Route | What it does |
|---|---|
|
Answers the status of the sign-in, with no token. Any user who can read connections can call it. |
|
Starts a sign-in, with the body |
|
The address Databricks sends the browser back to, with |
|
Disconnects: removes the sign-in, and answers |
The status is the same object that the connection carries as signIn in GET /connections and GET /connections/{connectionId}, without redirectUri:
{
"supported": true,
"provider": "databricks",
"status": "SIGNED_IN",
"identity": { "name": "Jane Doe", "email": "jane@acme.com" },
"workspace": "https://dbc-1a2b3c4d-5e6f.cloud.databricks.com",
"signedInAt": 1767000000000,
"signedInBy": "admin",
"lastRefreshedAt": 1767003600000,
"reason": null,
"redirectUri": "https://core-hub-host/connections/oauth/callback"
}
status is NOT_SIGNED_IN, SIGNED_IN or REAUTH_REQUIRED. signedInAt and lastRefreshedAt are Unix times in milliseconds, signedInBy is the Core Hub user who signed in, and reason is a short sentence when the status is REAUTH_REQUIRED. Fields that do not apply are left out or null. A connection that is not set up to sign in answers {"supported": false}. No route returns a token.