For the complete documentation index, see llms.txt. This page is also available as Markdown.

Automated Setup

Run one script to create the Databricks service principal, warehouse, system schemas and grants that SeeMore Data needs — then verify them before you connect.

The script below does every step of Create Databricks Service Principal and Privileges in one command: the service principal and a secret scoped to the APIs SeeMore Data calls, workspace membership with the Workspace access and Databricks SQL access entitlements, seemore_warehouse, the system schemas and grants, query text access, and the warehouse and endpoint permissions. It then verifies the result by reading the five required tables as the service principal, not as you, and prints the values to enter in SeeMore Data.

The defaults cover everything you have. The script grants BROWSE on all your catalogs except Databricks' own, Can monitor on every other SQL warehouse, and Can view on every model serving endpoint. It also adds the service principal to databricks_pii_access, so SeeMore Data can read your query text; pass --no-query-text-access to skip that. --dry-run lists every object it would touch. To inventory only some catalogs, pass --no-asset-catalog and grant BROWSE by hand. Permissions and Data Handling explains what each permission allows.

It's yours to read before you run it. Nothing is sent to SeeMore Data, nothing is written to disk, and every call it makes is one you could make yourself in the Databricks console.

Safe to re-run. The service principal and seemore_warehouse are matched by name and reused, existing workspace membership is left as it is, and every permission is added rather than replaced. No new secret is generated unless you pass --new-secret, and verification is skipped on a run that doesn't generate one — the script says so. If a check fails, fix the cause and run it again.

Before you start

  • Python 3.10 or later, which the Databricks SDK requires, and the SDK itself, version 0.152.0 or later, the first that creates scoped secrets. On macOS, /usr/bin/python3 is older than that; check with python3 --version.

pip install "databricks-sdk>=0.152.0"
  • Account admin access, to create the service principal and its secret, and to add it to databricks_pii_access.

  • Workspace admin and metastore admin access on the workspace you prepare, for everything else.

  • A workspace attached to a Unity Catalog metastore. The script stops with a clear message if it isn't — SeeMore Data reads Unity Catalog system tables.

Authenticating

The script never asks for your credentials. It uses the Databricks SDK's standard authentication, which reads the same environment variables and ~/.databrickscfg profiles as the Databricks CLI.

Two logins are needed, because the account and the workspace are separate control planes:

Context
Used for
Provide it as

Account

Creating the service principal and its OAuth secret

DATABRICKS_ACCOUNT_ID, DATABRICKS_CLIENT_ID, DATABRICKS_CLIENT_SECRET, or --account-profile

Workspace

Entitlements, warehouse, system schemas, grants

DATABRICKS_HOST, DATABRICKS_TOKEN, or --workspace-profile

If you already use the Databricks CLI with named profiles, pass them directly and set nothing else:

The cloud is worked out from your workspace URL, so there's no separate flag for AWS, Azure or GCP.

Run it

Save the script as seemore_databricks_setup.py, then:

Read the plan. When it looks right, run the same command without --dry-run.

A successful run ends with what to enter in SeeMore Data:

Options

Flag
Default
What it does

--account-id

required

Your Databricks account ID, from the account console profile menu

--workspace-url

required

The workspace to prepare: the one you enter in SeeMore Data, or one in another region you want fetched

--dry-run

off

Print the plan and change nothing

--sp-name

seemore

Display name of the service principal

--warehouse-name

seemore_warehouse

Name of the SQL warehouse to create or reuse

--secret-lifetime-days

730

OAuth secret lifetime. SeeMore Data stops reading when it expires — record the date

--new-secret

off

Generate a fresh secret even though the principal already has one. Needed to rotate, or to run verification on a re-run

--no-serverless

off

Create a pro warehouse instead of serverless, where serverless isn't available

--no-query-text-access

off

Don't add the service principal to the account group that unmasks query text. The step then only reports

--no-asset-catalog

off

Skip BROWSE on your own catalogs. SeeMore Data then inventories no assets — costing is unaffected

--allowlist-ips

off

Add SeeMore Data's two egress IPs to the workspace IP access list (Enterprise tier). Only needed if your workspace restricts inbound access; context-based ingress is set separately — see step 7

--can-manage-warehouses

off

Grant Can manage instead of Can monitor on all your other warehouses, for editing warehouse settings from SeeMore Data

--account-profile

env

~/.databrickscfg profile for the account login

--workspace-profile

env

~/.databrickscfg profile for the workspace login

Query text is unmasked by default: the script creates the databricks_pii_access group if it's missing and adds the service principal. That shows SeeMore Data the full text of every query in the account — see Query text access. Pass --no-query-text-access if your policy doesn't allow it.

Can manage is granted only with --can-manage-warehouses, instead of Can monitor, and then on every other warehouse in the workspace. Editing a warehouse's settings from SeeMore Data needs it. To grant it on only some warehouses, leave the flag off and add it by hand — see Can manage.

More than one workspace. The script adds the service principal to the workspace you pass, then lists the account's other workspaces and whether it's a member of each. It never adds it to them, because that changes who can see what in a workspace you didn't nominate. Add the ones you want covered under Settings → Identity and access → Service principals, and give it the Workspace access and Databricks SQL access entitlements there. A workspace it isn't a member of still contributes its usage; only its hourly query history and live queries are missing.

More than one region. Each region has its own metastore, so run the script again with --workspace-url and --workspace-profile set to a workspace in that region. The run reuses the service principal and its secret, and prepares that region's warehouse, schemas and grants. Then choose that SQL warehouse under Additional regions in account on the Permission checks step, where its Check is the verification. A region you don't prepare still counts toward your total spend; only its query, compute and lineage detail is missing.

If a check fails

Verification runs as the service principal, so it tests what SeeMore Data will actually be able to read — a metastore admin can read the system tables whether or not the grants worked. It signs in with the service principal's new secret only, even if DATABRICKS_AUTH_TYPE or your profile names another way to sign in.

When a check fails, the script prints Databricks' own error alongside the exact GRANT statements that fix it. Grants can take a few seconds to propagate, so if a run finishes just after the grants were made, re-running the script is often all that's needed.

If the script stops before it does anything with no account credentials found or no workspace credentials found, it hasn't found a login for that context. The account and the workspace are separate logins — a workspace profile can't stand in for the account one. Run databricks auth profiles to see what you already have.

Two failures have causes the grants can't fix:

  • A system schema reported UNAVAILABLE — Databricks hasn't offered it to your account. Contact Databricks. A schema missing from Databricks' list but present in the system catalog is granted as usual, because the list leaves out some schemas Databricks has already enabled. The optional tags, serving, ai_gateway and mlflow are skipped without failing when they're missing from both — see step 4 for what that costs.

  • GRANT refused — the workspace login isn't a metastore admin. Grants on the system catalog can only be made by one.

One line in the verification output is a warning rather than a failure:

  • asset catalog: no catalogs visible — SeeMore Data will import no assets, so lineage and unused-table insights come out empty. Costing, query history and warehouse automation are unaffected, which is why this never fails the run. Either a BROWSE grant didn't land, or the account holds only Databricks' own catalogs; the script can't tell the two apart. A could not grant BROWSE on ... warning earlier in the run names the catalog that refused it.

The script

Next step

Integration with Seemore

Last updated