DataBricks
Connection Settings
Create a user for Narrator
Narrator just needs a personal access token to connect. This can be done either though an existing user, or with a service principal.
Option 1: Service Principal (cannot be done through the user interface)
- create a new service principal for Narrator to connect
- grant the can use token permission to it
- Create a Databricks personal access token on behalf of the service principal using the POST
/token-management/on-behalf-of/tokens operation
API in the token management REST API.
Further reading
Option 2: User
- Navigate to your Account Console
- create a new user, or identify an existing user Narrator can connect as
- generate a personal access token (see below)
Create an access token
Additional resources can be found in the following documentation
- Navigate to your Databricks workspace and click the
Settings Icon
in the lower-left corner as shown below. Then go to yourUser Settings
- Navigate to the
Access Tokens
tab and click onGenerate New Token
as shown below.
Ensure you have a SQL Warehouse
go to SQL > Create > SQL warehouse if it hasn't been created
Get your connection details
-
Navigate to your Databricks workspace and click the
SQL Endpoints icon
present in the sidebar. -
Choose an endpoint where you want to connect.
-
Navigate to the
Connection Details
tab and copy theserver Hostname
andHTTP Path
details as shown below.
- Click
Test Connection
Connecting using SSH Tunnel
Narrator's Public Key
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHQLZ/BQf5GDPRfXmHt9ecmChGjhOWZsZZOGsn82M1nJ
Connect in Narrator
Navigate to the Narrator warehouse settings page and enter the credentials to connect your warehouse
If connecting doesn't work ensure the user has
databricks-sql-access
permissions. It should be granted by default
Permissions
Narrator needs the proper permissions to query source tables and manage its activity stream.
Here's how Narrator works with the warehouse
- We have full access to one schema, called
narrator
by convention, where we create and update the activity stream tables, enrichment tables, materialized views, etc - We have readonly access to any schemas we need to query to build the activity stream
Create the Narrator Schema
Create the narrator
and narrator_mv
schemas and grant all privileges to the narrator user
CREATE SCHEMA narrator;
GRANT ALL PRIVILEGES ON SCHEMA narrator TO `...`;
CREATE SCHEMA narrator_mv;
GRANT ALL PRIVILEGES ON SCHEMA narrator_mv TO `...`;
If
ALL PRIVILEGES
seems like too much grantSELECT, CREATE, MODIFY, USAGE, READ_METADATA
Grant access to all needed schemas
Grant select on all source data schemas Narrator will need to access
GRANT USAGE, READ_METADATA, SELECT ON SCHEMA <schema_name> TO `...`
Updated about 2 years ago