Warehouses

Connect Databricks

Connect a Databricks SQL warehouse as a service principal or with a personal access key, with read rights on the data to query.

On this page

Databricks connects to one SQL warehouse, as a service principal or with a personal access key. Statements run as that identity, with its rights.

Availability. The Databricks connector must be on for your workspace. See Connect a data warehouse.

Set up a service principal

A service principal is the safer choice, because it has only the rights you give it.

  1. In the workspace, open Settings › Identity and access › Service principals, add one for Ahamo, and note its application ID.

  2. In the SQL warehouse's permissions, give the service principal Can use, on this warehouse only. A small warehouse with auto-stop keeps the cost down.

  3. In a SQL editor, as an owner of the data, give it read rights. Use your own names.

    GRANT USE CATALOG ON CATALOG main TO `<application-id>`;
    GRANT USE SCHEMA ON SCHEMA main.sales TO `<application-id>`;
    GRANT SELECT ON SCHEMA main.sales TO `<application-id>`;
  4. On the service principal's Secrets tab, choose Generate secret.

SELECT on a schema covers its tables and views, now and later. Grant nothing else, because MODIFY, CREATE and ownership write.

A personal access key runs as its user, with all of that user's rights. Use one only for a user that can only read.

Connect

  1. Open Connectors, find Databricks and choose Connect.
  2. Under Connect with, choose Service principal or Personal access key.
  3. Enter the workspace address, as in its URL, and the SQL warehouse ID, the end of its HTTP path /sql/1.0/warehouses/….
  4. Choose what the identity can do. Choose Only read when it has USE CATALOG, USE SCHEMA and SELECT alone. With Change data, you approve each statement in a card.
  5. Paste the client ID and the secret, or the personal access key. Ahamo keeps it encrypted and never shows it again.
  6. Name the connection, choose who may use it, and choose Test and connect.

Ahamo doesn't read the SQL. If the identity gets rights that write later, Ahamo can't tell.

Limits

A statement may run for 2 minutes, then Ahamo stops it. The warehouse runs and bills it until then. Every statement carries your Ahamo id as a query tag, which Databricks' query history shows.

Troubleshooting

This is a personal access key, not a service principal's secret. Choose Personal access key under Connect with, or paste the secret from the service principal's Secrets tab.

Databricks didn't accept the client ID and secret. Paste the service principal's application ID and a current secret. A secret is shown only once.

The workspace refused Ahamo. Add the service principal to this workspace. A workspace that allows only listed addresses can't be connected yet, see Feature availability.

Databricks no longer accepts this connection's secret or key. Secrets and keys expire, and Databricks deletes one that hasn't been used for 90 days. Open the connection, choose Paste a new key and paste a new one.

On this page