@@ -23,21 +23,28 @@ BigQuery uses **Application Default Credentials (ADC)** — there is no token in
2323TOML; the credentials must be visible to the ** server process** . Three common
2424paths:
2525
26- 1 . ** Service account JSON** (production): create a service account with
27- ` roles/bigquery.dataViewer ` on the target datasets, then point the server at
28- it:
26+ 1 . ** Service account JSON** (production): in Google Cloud Console, open
27+ * IAM & Admin → Service Accounts* → ** Create service account** . Name it
28+ ` mfs-bigquery-reader ` , grant ` roles/bigquery.dataViewer ` on the target
29+ datasets or project, then open the service account's * Keys* tab →
30+ ** Add key → Create new key → JSON** . Store the downloaded JSON outside the
31+ repo and point the server at it:
2932
3033 ``` bash
3134 export GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa.json
3235 mfs-server run
3336 ```
3437
35- 2. ** ` gcloud auth application-default login` ** (dev / single-user) — writes
36- ` ~/.config/gcloud/application_default_credentials.json` .
38+ 2. ** ` gcloud auth application-default login` ** (dev / single-user): run it as
39+ the same OS user that starts ` mfs-server` . It opens a browser consent flow and
40+ writes ` ~/.config/gcloud/application_default_credentials.json` .
3741
38423. ** Workload Identity** on GKE / Cloud Run — ADC is automatic.
3943
40- Make sure the ** BigQuery API** is enabled on the project.
44+ Before any of those, open * APIs & Services → Library → BigQuery API* and enable
45+ it on the project. If the connector can authenticate but cannot list a dataset,
46+ check the dataset IAM page first; the service account needs read access to every
47+ dataset listed in ` datasets` .
4148
4249! [Google Cloud BigQuery API page](https://github.com/user-attachments/assets/fd034ea0-4607-4e74-b65a-106460830889)
4350
@@ -58,6 +65,13 @@ text_fields = ["title", "body_markdown"]
5865locator_fields = [" article_id" ]
5966` ` `
6067
68+ Save the file as ` bigquery.toml` , then probe before the first index:
69+
70+ ` ` ` bash
71+ mfs connector probe bigquery://analytics --config ./bigquery.toml
72+ mfs add bigquery://analytics --config ./bigquery.toml
73+ ` ` `
74+
6175# # Sync and freshness
6276
6377The connector uses the table' s `modified` time as its cursor; deletions are caught
@@ -67,8 +81,6 @@ tables.
6781## Search and browse
6882
6983```bash
70- mfs add bigquery://analytics --config ./bigquery.toml
71-
7284mfs search "refund event" bigquery://analytics/events/tables/user_events/rows.jsonl
7385mfs search "email column" bigquery://analytics --kind schema_summary
7486mfs cat bigquery://analytics/kb/tables/articles/rows.jsonl --locator ' {" article_id" :" a-123" }'
@@ -80,3 +92,5 @@ mfs cat bigquery://analytics/kb/tables/articles/rows.jsonl --locator '{"article_
8092- BigQuery has no primary key for most tables — choose stable `locator_fields`
8193 explicitly.
8294- Rows need `text_fields` to be searchable.
95+ - User ADC from `gcloud` is convenient for local testing; service accounts or
96+ workload identity are easier to operate in long-running deployments.
0 commit comments