Skip to content

Commit edb9084

Browse files
authored
Update BigQuery-setup.md
Missing critical step #2 for BigQuery warehouse permissions setup
1 parent d0f1e15 commit edb9084

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/unify/data-graph/setup-guides/BigQuery-setup.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,21 @@ To set the roles and permissions:
3030
11. Copy all the content in the JSON file you created in the previous step, and save it for Step 5.
3131

3232

33-
## Step 2: Grant read-only access for the Data Graph
33+
## Step 2: Create a dataset for Segment to store checkpoint tables
34+
**Segment requires write access to this dataset for internal bookkeeping and to store checkpoint tables for the queries that are executed. Therefore, Segment recommends creating a new dataset for this purpose.**
35+
36+
> info ""
37+
> Segment recommends creating a new dataset for the Data Graph.
38+
> If you choose to use an existing dataset that has also been used for [Segment Reverse ETL](/docs/connections/reverse-etl/), you must follow the [additional instructions](#update-user-access-for-segment-reverse-etl-catalog) to update user access for the Segment Reverse ETL catalog.
39+
40+
Navigate to the BigQuery SQL editor and create a dataset that will be used by Segment.
41+
42+
```
43+
CREATE SCHEMA IF NOT EXISTS `__segment_reverse_etl`;
44+
GRANT `roles/bigquery.dataEditor` ON SCHEMA `__segment_reverse_etl` TO "serviceAccount:<YOUR SERVICE ACCOUNT EMAIL>";
45+
```
46+
47+
## Step 3: Grant read-only access for the Data Graph
3448
Grant the [BigQuery Data Viewer](https://cloud.google.com/bigquery/docs/access-control#bigquery.dataViewer){:target="_blank"} role to the service account at the project level. Make sure to grant read-only access to the Profiles Sync project in case you have a separate project.
3549

3650
To grant read-only access for the Data Graph:
@@ -41,7 +55,7 @@ To grant read-only access for the Data Graph:
4155
5. Select the **BigQuery Data Viewer role**.
4256
6. Click **Save**.
4357

44-
## *(Optional)* Step 3: Restrict read-only access
58+
## *(Optional)* Step 4: Restrict read-only access
4559
If you want to restrict access to specific datasets, grant the BigQuery Data Viewer role on datasets to the service account. Make sure to grant read-only access to the Profiles Sync dataset.
4660

4761
To restrict read-only access:
@@ -58,15 +72,15 @@ You can also run the following command:
5872
GRANT `roles/bigquery.dataViewer` ON SCHEMA `YOUR_DATASET_NAME` TO "serviceAccount:<YOUR SERVICE ACCOUNT EMAIL>";
5973
```
6074

61-
## Step 4: Validate permissions
75+
## Step 5: Validate permissions
6276
1. Navigate to **IAM & Admin > Service Accounts** in BigQuery.
6377
2. Search for the service account you’ve just created.
6478
3. From your service account, click the three dots under **Actions** and select **Manage permissions**.
6579
4. Click **View Access** and click **Continue**.
6680
5. Select a box with List resources within resource(s) matching your query.
6781
6. Click **Analyze**, then click **Run query**.
6882

69-
## Step 5: Connect your warehouse to Segment
83+
## Step 6: Connect your warehouse to Segment
7084
1. Navigate to **Unify > Data Graph** in Segment. This should be a Unify space with Profiles Sync already set up.
7185
2. Click **Connect warehouse**.
7286
3. Select *BigQuery* as your warehouse type.

0 commit comments

Comments
 (0)