Connect your Databricks SQL warehouse to Tekst so Tekst can read the ERP data you keep there. For example, Process Intelligence can use SAP's sales, delivery and billing tables (such as vbak, vbap, likp, lips, vbrk, vbrp and vbfa) to analyze your processes. Tekst only reads: it never writes to your warehouse.
Tekst signs in with a Databricks service principal and an OAuth secret, not with a user account.
Before you start
Check the following before you connect:
- Your data is in one schema of a Unity Catalog catalog, with at least one table in it. Tekst connects to a single schema, so keep the tables it needs together in the same one.
- You have a SQL warehouse Tekst can query. A serverless warehouse is fine.
- Public network access to the workspace. Tekst connects over the internet. A workspace that is only reachable through Private Link can't be connected. If your workspace uses an IP access list, allow Tekst's outbound IP addresses listed in Troubleshoot Firewall.
- Someone who can add a service principal to the Databricks workspace, generate a secret for it, and grant access on the catalog and the warehouse.
- You have the Admin or Contributor role in Tekst.
Step 1: Copy the connection details
In Databricks, go to SQL Warehouses, open the warehouse Tekst should use and open the Connection details tab. Copy the Server hostname and the HTTP path.
Step 2: Create a service principal and a secret
- In Databricks, go to Settings > Identity and access > Service principals and click Add service principal.
- In the Service principal field, type a name you will recognize, then click Add new service principal to account and workspace.
- In the Add service principal to account and workspace dialog, choose Databricks managed under Management. The Service principal name is filled in. Under Configure entitlements, keep Databricks SQL access on and Admin access off. Click Add service principal.
- Open the new service principal and go to the Secrets tab. Click Generate secret.
- In the Generate OAuth secret dialog, set the Lifetime (days), at most 730. Under Scope, make sure the
sqlscope is listed with the access level Read + Restricted query. If it isn't listed, click Add scope, addsqland set it to Read + Restricted query. Click Generate.
- Copy the Secret and the Client ID right away. Databricks shows the secret only once. The scope shows as
sql:read:restricted-query.
The secret is then listed on the Secrets tab, with sql:read:restricted-query under Scopes and the date it stops working under Expires at.
Step 3: Give the service principal read access
- Open the SQL Editor and select the warehouse in the compute picker on the right of the toolbar. Run the following, replacing
<catalog>,<schema>and<client-id>with your own values.<client-id>is the service principal's Client ID, which Databricks also shows as its Application ID.
GRANT USE CATALOG ON CATALOG <catalog> TO `<client-id>`;
GRANT USE SCHEMA, SELECT ON SCHEMA <catalog>.<schema> TO `<client-id>`;
- Go to SQL Warehouses, open the warehouse and click Permissions.
- Add the service principal with Can use.
That is all Tekst needs: it only reads, so it needs no admin rights. Tekst only sees the tables this service principal can read.
Step 4: Connect in Tekst
- Go to Integrations and click Connect Integration.
- Find Databricks (Databricks SQL warehouse, category Data warehouse) and click Connect.
- In the Connect Databricks dialog, fill in all six fields:
-
Workspace host: the Server hostname from Step 1. Host name only, no
https://. - HTTP path: the HTTP path from Step 1.
- Client ID and Client secret: from Step 2.
- Catalog and Schema: where your tables are.
-
Workspace host: the Server hostname from Step 1. Host name only, no
- Click Connect. The button stays disabled until every field is filled in.
Expected result: Tekst checks that it can sign in and see at least one table in the schema. The dialog closes, and the integration's configuration panel opens showing Connected. If the warehouse is stopped, connecting can take a few minutes while it starts.
Verify the connection later
Open the integration, go to the Advanced tab and click Verify connection. Tekst doesn't recheck the connection by itself, so verify again after you change the client secret or the access of the service principal.
What happens next
Tekst support reviews with you which tables Tekst loads and runs the first sync. Syncs don't run on a schedule, so the data in Tekst is as current as the last sync. To update it, a user with the Admin or Contributor role opens the integration, goes to the Catalog tab and clicks Sync.
Change the client secret
The secret stops working when its lifetime ends, and Databricks revokes a secret that hasn't been used for 90 days. Tekst does not warn you before that happens. The next sync fails instead, so renew the secret in time.
- Generate a new secret on the service principal with the same scope, as in Step 2.
- In Tekst, open the integration, go to the Settings tab and click Reconnect.
- Fill in all fields again, with the new secret.
With the same Workspace host, Catalog and Schema, Tekst updates the existing integration. Tell Tekst support, because their table setup is reset. A different Workspace host, Catalog or Schema creates a second integration.
Troubleshooting
Connect errors appear in red at the top of the Connect Databricks dialog.
- "Could not connect to the warehouse: Token request failed:
invalid_client(Client authentication failed)" - the Client ID or Client secret is wrong, or the secret was revoked. Generate a new secret and connect again. - "Could not connect to the warehouse: Token request failed:
access_denied..." - the secret doesn't have the scope from Step 2,sql:read:restricted-query. This happens, for example, with a secret created at plain Read. Generate a new secret at Read + Restricted query. -
Schema "<schema>" not found in catalog "<catalog>", or has no tables visible to this service principal- the schema name is wrong, or Step 3 is missing. - "Could not connect to the warehouse: timed out waiting for the SQL warehouse (it may still be starting)" - the warehouse took too long to start. Wait a minute and connect again.
If you have an issue following this guide or have any other questions, please submit a request or send your question to support@tekst.com.
0 comments
Please sign in to leave a comment.