Prerequisites
You’ll need to create a custom role and service account in GCP. This role and service account must be added to each Project you want Sidecar to ingest metadata for.1. Setting up a role and service account
- GCP Console
- Bash Script
Create a custom role in GCP
- Navigate to
Rolesin theIAM & Adminsection. - Click the
+ Create Rolebutton. - Give the new role a name such as
Sidecar Data BigQuery. - Click
+ Add Permissions, and add the following permissions:
serviceusage.services.use lets Sidecar use the service account project for
API quota and billing. Keep it in this custom role; no additional IAM role
is required for this access.- Click
Createto create the role. - Repeat the role creation process for each Project you want Sidecar to ingest metadata for.
Create a service account
- Navigate to
Service accountsin theIAM & Adminsection. - Click
+ Create Service Account. - Give the new service account a name like
sidecar-data. - Under “Grant this service account access to project”, select the custom role you created above.
- Click
Done. - For all other Projects you want Sidecar to ingest metadata for:
- Navigate to
IAMin theIAM & Adminsection. - Click
+ Grant Access. - Under “Add principals”, enter the email address generated for the service account.
- Under “Assign roles”, select the custom role you created.
- Click
Save.
- Navigate to
2. Create and download key credentials
- For your primary Project, navigate to
Service accountsin theIAM & Credentialssection. - Find the service account you created for Sidecar, click the 3 dots and click
Manage keys. - Click
Add key, thenCreate new key. - Select JSON as the Key type.
- Click
Create. This will download a JSON file to your machine.
3. Upload your service account key to Sidecar
- In the Onboarding page (or Account Settings), navigate to “Connect your data warehouse” and select “BigQuery”.
- Select the downloaded JSON key file from Step 2.
- Click
TestthenSave.
4. Additional permissions
- Cloud Resource Manager API and Cloud Asset API must be enabled.
- Add the
Cloud Asset Viewerrole to the Sidecar service account.
5. Optional Storage Read API activity
Capture Storage Read API activity for deprecation recommendations
Capture Storage Read API activity for deprecation recommendations
Spark, Dataproc, and other clients can read BigQuery tables through the
Storage Read API without creating a query job. Complete this setup if you
want Sidecar to treat those direct reads as activity when evaluating
query activity.Sidecar reads from one dedicated Cloud Logging view for each BigQuery
integration. The view must receive matching events from every project that
owns BigQuery tables selected in Sidecar.In Sidecar, open Integrations → BigQuery, enter this value in
Storage Read LogView resource name, and click Save. Enter the full
resource name, not a Google Cloud Console URL or a project ID.Sink and IAM changes can take several minutes to propagate. If your
organization uses intercepting sinks, confirm that a fresh test read reaches
this dedicated view.Learn more in Google’s guides to route
logs,
manage log buckets, and
configure log views.
Reuse the service account and JSON key from steps 1–3. You don’t need a new
service account or key. The existing
logging.operations.list permission does
not grant access to Data Access logs.Before you begin
Gather the following values:- Sidecar service account email: the
client_emailin the JSON key you uploaded to Sidecar. - BigQuery project IDs: every project that owns tables selected in the Sidecar integration.
- Logging project ID: the project that will own the dedicated log bucket and view. For one BigQuery project, use that same project.
- Retention period: use at least 90 days. If your Sidecar deprecation inactivity threshold is longer than 90 days, use at least that threshold plus one day.
logging.googleapis.com in the logging project and in the service
account’s project (project_id in the JSON key). These are often the same
project. Ensure the Sidecar custom role is granted to the service account in
that project and includes serviceusage.services.use. If the custom role was
created only in other projects, create or update the same project-level custom
role here and grant it to the Sidecar service account. No other Service Usage
permissions are required for this setup.- GCP Console
- Terraform
Create the log bucket
- Select the logging project in the Google Cloud Console.
- Open APIs & Services → Library → Cloud Logging API and click Enable if the API isn’t already enabled.
- Open Logging → Logs Storage and click Create log bucket.
- Enter
sidecar-bigquery-storage-readsas the bucket name. - Choose a location and record it. The location can’t be changed later.
- Set the retention period determined above.
- Leave Upgrade to use Observability Analytics unchecked. Sidecar doesn’t require it.
- Click Create bucket.
Route Storage API reads into the bucket
Repeat these steps in every BigQuery project selected in Sidecar:- Select the BigQuery project in the Google Cloud Console.
- Open Logging → Log Router and click Create sink.
-
Enter
sidecar-bigquery-storage-readsas the sink name. - Choose Cloud Logging bucket as the sink service.
-
Select the dedicated bucket. If the bucket is in another project, use
its full destination:
-
In Build inclusion filter, enter:
- Add no exclusion filters and click Create sink.
-
If the bucket is in a different project, open the sink details and copy
its writer identity. In the logging project, grant that identity
Logs Bucket Writer (
roles/logging.bucketWriter). A same-project destination doesn’t need this grant.
Create the restricted log view
- Return to Logging → Logs Storage in the logging project.
-
Open the
sidecar-bigquery-storage-readsbucket. - Under Log views, click Create log view.
-
Enter
sidecar-bigquery-storage-readsas the view name. -
Enter this view filter:
- Save the view.
- From the view’s Actions menu, select Adjust permissions.
-
Add the Sidecar service account email and assign Logs View Accessor
(
roles/logging.viewAccessor).
roles/logging.privateLogViewer, project-level
roles/logging.viewAccessor, roles/logging.bucketWriter, or a Logging
administration role.Add the view to Sidecar
Copy the complete view resource name. It has this format:Verify the view
After a new Spark or direct Storage API read completes, run this command in Cloud Shell:Add BigQuery MCP to Agent Console
The warehouse connection above does not automatically provide query tools to agents. Themcp.tools.call permission in the custom role enables Google’s
managed MCP servers. Follow Set up BigQuery
MCP to confirm the connection.