Skip to main content
The Databricks direct connector lets Evidence run queries live against your own Databricks workspace via a SQL Warehouse, using Unity Catalog.

Connecting

You need three things: the workspace server hostname, the SQL Warehouse HTTP path, and an authentication credential — either a personal access token or an OAuth service principal.
1

Find your SQL Warehouse connection details

In the Databricks workspace, open SQL Warehouses, select your warehouse, and open the Connection details tab. Copy the Server hostname (e.g. dbc-a1b2c3d4-e5f6.cloud.databricks.com) and the HTTP path (e.g. /sql/1.0/warehouses/abc123def456).
2

Create a credential

Personal access token (PAT): under Settings → Developer → Access tokens, generate a token (dapi…).OAuth M2M (recommended for production): create a service principal and an OAuth secret, then grant it access to the warehouse and catalog. You’ll use its client ID and client secret.
3

Configure the connector in Evidence

Go to Connectors in the sidebar, choose Databricks in the Warehouse card, and fill in the host, HTTP path, and catalog. Pick the authentication method and enter the token (or client ID + secret).
4

(Optional) Restrict the schema browser

Add schema names to Schemas to limit which ones appear in the schema browser. Leave empty to show just the connection’s default schema.
5

Test and save

Click Test Connection. Once it passes, click Save.

Grant least-privilege access

Give the connecting identity (PAT user or service principal) only what it needs: USE CATALOG / USE SCHEMA and SELECT on the objects Evidence should read. In a SQL editor:
Replace evidence with your service principal’s application ID (or the token user).

Configuration reference

Credentials

string
required
Databricks workspace hostname, e.g. dbc-a1b2c3d4-e5f6.cloud.databricks.com or adb-1234567890.1.azuredatabricks.net.
string
required
SQL Warehouse HTTP path, e.g. /sql/1.0/warehouses/abc123def456 (Warehouse → Connection details).
string
Databricks personal access token (dapi…). Mutually exclusive with OAuth.
string
Service-principal (M2M) client ID for OAuth. Required when authenticating with a client secret.
string
Service-principal (M2M) OAuth secret. Requires client ID; mutually exclusive with the access token.
string
required
Unity Catalog catalog to query.
string
Schema used when queries reference unqualified table names. Default: "default".

Visibility

string[]
Allowlist of schemas exposed to the editor and schema browser. Defaults to the connection schema when empty. Default: [].

Row-level security

{ databricksVariable: string; evidenceVariable: `user.email` | `user.id` | `user.name` | `organization.id` }[]
Evidence identity → Databricks SQL session variable, SET per query for RLS row filters. Default: [].
{ name: string; client_id: string }[]
Named service principals (OAuth M2M) that queries run as per Evidence user, so Unity Catalog row filters and column masks can key on current_user() or group membership. Client secrets are set in Access Rules. Default: [].

Row-Level Security

Databricks row filters and column masks apply to queries Evidence issues. They evaluate against the identity running the query, through current_user() and is_account_group_member(). By default that is the connection identity (the PAT user or service principal).

Access roles

To give different Evidence users different data, Evidence can run each user’s queries as a different service principal.
  • Each access role pairs a label with a service principal’s OAuth client ID and secret.
  • Admins assign each Evidence user an access role under Settings → Access Rules.
  • When a user runs a query, Evidence connects as that user’s service principal, so current_user() returns the principal’s application ID.
  • Users without an assigned role run as the connection identity.
Unassigned users see whatever the connection identity can see. Give the connection identity the narrowest grants, and put broader access on the roles.
1

Create one service principal per access group

In your Databricks account, create a service principal for each access boundary (for example evidence-emea and evidence-apac), generate an OAuth secret for it, and grant it CAN USE on the SQL Warehouse and SELECT on the tables it needs.
2

Key your row filters on the principal

Add each principal to an account group, then filter on group membership:
For many groups, join current_user() against a mapping table instead.
3

Register the roles in Evidence

Go to Settings → Access Rules and add each principal’s client ID and secret under Roles, with a label. The secret is stored encrypted and never shown again; leave it blank to keep the stored one.
4

Assign users

Under User Assignments, assign each user a role. Access Preview shows what a user can see in a table and the current_user() value their queries run as.

Session variables

To filter per Evidence viewer, map Evidence identity attributes to Databricks SQL session variables under Session Variables (RLS) in the connection form (or session_variables in connection.yaml). Before each query Evidence runs DECLARE OR REPLACE VARIABLE <name> STRING DEFAULT '<value>', so your row-filter function can read the current viewer’s identity:

Security Considerations

Evidence executes queries against your Databricks workspace. Take pragmatic steps to protect it against misuse, whether accidental or malicious.
  1. Use a dedicated service principal or token user with SELECT-only grants — avoid an admin identity.
  2. Scope grants to the specific catalog and schemas Evidence should see, not the whole metastore.
  3. Attach the SQL Warehouse to a workspace with an IP access list restricted to Evidence’s egress IPs plus your team’s networks.
  4. Rotate PATs regularly, or prefer OAuth M2M (short-lived tokens) for production.
  5. Monitor query history for non-SELECT statements from the Evidence identity (there shouldn’t be any).