You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At a high level, when you set up Databricks for Reverse ETL, the configured user needs read permissions for any resources (databases, schemas, tables) the query needs to access. Segment keeps track of changes to your query results with a managed schema (`__SEGMENT_REVERSE_ETL`), which requires the configured user to allow write permissions for that schema.
7
+
At a high level, when you set up Databricks for Reverse ETL, the configured service-principal needs read permissions for any resources (databases, schemas, tables) the query needs to access. Segment keeps track of changes to your query results with a managed schema (`__SEGMENT_REVERSE_ETL`), which requires the configured service-principal to allow write permissions for that schema.
8
+
9
+
> info ""
10
+
> Segment supports only OAuth (M2M) authentication. To generate client ID and Secret, follow the steps listed in the [Databricks docs: OAuth machine-to-machine (M2M) authentication](https://docs.databricks.com/en/dev-tools/auth/oauth-m2m.html){:target="_blank"}.
11
+
8
12
9
13
## Required permissions
10
-
* Make sure the user or the service principal you use to connect to Segment has permissions to use that warehouse. In the Databricks console go to **SQL warehouses** and select the warehouse you're using. Navigate to **Overview > Permissions** and make sure the user or the service principal you use to connect to Segment has *can use* permissions.
14
+
* Make sure the service principal you use to connect to Segment has permissions to use that warehouse. In the Databricks console go to **SQL warehouses** and select the warehouse you're using. Navigate to **Overview > Permissions** and make sure the service principal you use to connect to Segment has *can use* permissions.
11
15
12
16
* To grant access to read data from the tables used in the model query, run:
13
17
14
18
```
15
-
GRANT USAGE ON SCHEMA <schema_name> TO `<user or service principal you are using to connect to Segment>`;
16
-
GRANT SELECT, READ_METADATA ON SCHEMA <schema_name> TO `<user or service principal you are using to connect to Segment>`;
19
+
GRANT USAGE ON SCHEMA <schema_name> TO `<service principal you are using to connect to Segment>`;
20
+
GRANT SELECT, READ_METADATA ON SCHEMA <schema_name> TO `<service principal you are using to connect to Segment>`;
17
21
```
18
22
19
23
* To grant Segment access to create a schema to keep track of the running syncs, run:
20
24
21
25
```
22
-
GRANT CREATE on catalog <name of the catalog, usually hive_metastore or main if using unity-catalog> TO `<user or service principal you are using to connect to Segment>`;
26
+
GRANT CREATE on catalog <name of the catalog, usually hive_metastore or main if using unity-catalog> TO `<service principal you are using to connect to Segment>`;
23
27
```
24
28
25
29
* If you want to create the schema yourself instead and then give Segment access to it, run:
26
30
27
31
```
28
32
CREATE SCHEMA IF NOT EXISTS __segment_reverse_etl;
29
-
GRANT ALL PRIVILEGES ON SCHEMA __segment_reverse_etl TO `<user or service principal you are using to connect to Segment>`;
33
+
GRANT ALL PRIVILEGES ON SCHEMA __segment_reverse_etl TO `<service principal you are using to connect to Segment>`;
30
34
```
31
35
32
36
## Set up guide
@@ -46,12 +50,14 @@ To set up Databricks as your Reverse ETL source:
46
50
* Hostname: `adb-xxxxxxx.azuredatabricks.net`
47
51
* Http Path: `/sql/1.0/warehouses/xxxxxxxxx`
48
52
* Port: `443` (default)
49
-
* Token: `<your-token>`
50
-
* Catalog [optional]: `hive_metastore` (default)
53
+
* Service principal client ID: `<your client ID>`
54
+
* OAuth secret: `<OAuth secret to be used during connection>`
55
+
* Catalog [optional]: `<if not specify, Segment will use the default catalog>`
51
56
11. Click **Test Connection** to see if the connection works. If the connection fails, make sure you have the right permissions and credentials, then try again.
52
57
12. Click **Add source** if the test connection is successful.
53
58
54
-
> info ""
55
-
> To generate a token, follow the steps listed in the [Databricks docs](https://docs.databricks.com/dev-tools/auth.html#pat){:target="_blank"}. Segment recommends you create a token with no expiration date by leaving the lifetime field empty when creating it. If you already have a token with an expiration date, be sure to keep track of the date and renew it on time.
59
+
> warning ""
60
+
> Segment previously supported token-based authentication, but the authentication method has been changed based on Databricks' recommendation.
61
+
> If you set up your source in the past using a token, it will still be supported; however, for new source or for updating the connection settings of an existing source, we will only support [OAuth machine-to-machine (M2M) authentication](https://docs.databricks.com/en/dev-tools/auth/oauth-m2m.html){:target="_blank"}.
56
62
57
63
Once you've succesfully added your Databricks source, [add a model](/docs/connections/reverse-etl/#step-2-add-a-model) and follow the rest of the steps in the Reverse ETL setup guide.
0 commit comments