Requirements
Before connecting, ensure you have:- Google Cloud Platform (GCP) account with an active project
- BigQuery API enabled in your project
- Service account with
bigquery.datasets.getandbigquery.tables.listpermissions - Service account JSON key for authentication
Connection Settings
| Field | Description | Example |
|---|---|---|
| Asset Name | Friendly identifier for this connection | BigQuery Production |
| Project ID | GCP project ID | my-analytics-project |
| Service Account JSON | Full JSON key contents | {"type": "service_account", ...} |
| Default Dataset (Optional) | Scope introspection to a single dataset | analytics |
| Location (Optional) | BigQuery data location/region | US, EU, us-east1 |
Service Account JSON Input
You can provide the service account JSON in two ways:- File Upload: Click Upload JSON File to select your downloaded key file
- Paste: Copy and paste the entire JSON contents into the text area
Default Dataset
If your project has many datasets, use the Default Dataset field to scope introspection to a single dataset. This is useful for:- Large projects with 100+ datasets
- Focusing on production data only
- Reducing discovery time
Location
The Location field specifies where your BigQuery data resides. Common options:| Location | Description |
|---|---|
US | United States (multi-region) |
EU | European Union (multi-region) |
us-east1 | South Carolina |
us-west1 | Oregon |
europe-west1 | Belgium |
europe-west2 | London |
asia-northeast1 | Tokyo |
BigQuery uses project-level connections. Without a default dataset, all datasets within the project will be discovered automatically.
Creating a Service Account
Step 1: Create Service Account
- Go to GCP Console > IAM & Admin > Service Accounts
- Click Create Service Account
- Enter details:
- Name:
anomalyarmor - Description:
AnomalyArmor schema monitoring
- Name:
- Click Create and Continue
Step 2: Assign Roles
Grant the minimum required roles:| Role | Purpose |
|---|---|
| BigQuery Data Viewer | Read table/view metadata and data |
| BigQuery Job User | Execute queries for introspection |
| Role | ID | Purpose |
|---|---|---|
| BigQuery Data Viewer | roles/bigquery.dataViewer | Read metadata and table contents |
| BigQuery Job User | roles/bigquery.jobUser | Run queries in the project |
Step 3: Create JSON Key
- Click on the created service account
- Go to Keys tab
- Click Add Key > Create new key
- Select JSON format
- Download and securely store the key file
Minimal Permissions
For maximum security, create a custom role with only these permissions:Finding Your Project ID
Your project ID is shown in multiple places in GCP Console:- Dashboard: Top-left dropdown shows project name and ID
- URL:
console.cloud.google.com/bigquery?project=YOUR-PROJECT-ID - Project Settings: IAM & Admin > Settings
Enabling BigQuery API
If the BigQuery API is not enabled:- Go to GCP Console > APIs & Services > Library
- Search for “BigQuery API”
- Click Enable
What We Monitor
AnomalyArmor discovers and monitors these BigQuery objects:| Object Type | Monitored | Notes |
|---|---|---|
| Tables | Yes | Standard and partitioned |
| Views | Yes | Standard views |
| Materialized Views | Yes | Treated as views |
| External Tables | Yes | Schema only, not source |
| Datasets | Yes | As schemas/namespaces |
| Routines | No | Functions/procedures not monitored |
| Models | No | ML models not monitored |
Metadata Captured
For each table and view:- Table name and dataset
- Column names and data types
- Nullability
- Last modified timestamp (for freshness)
- Partitioning information
Connection Architecture
What We Query
AnomalyArmor runs these types of queries:Cost Estimation
| Metric | Value |
|---|---|
| Query type | Metadata queries (minimal cost) |
| Data scanned | ~1KB per INFORMATION_SCHEMA query |
| Estimated cost | < $0.01 per discovery |
INFORMATION_SCHEMA queries in BigQuery are free. The only cost is for freshness checks that query actual tables, which scan minimal data.
Multiple Projects
To monitor multiple GCP projects, create separate data sources for each:| Data Source | Project |
|---|---|
| BigQuery Production | prod-analytics-123 |
| BigQuery Staging | staging-analytics-456 |
| BigQuery Development | dev-analytics-789 |
Cross-Project Access
To use one service account for multiple projects:VPC Service Controls
If your BigQuery is protected by VPC Service Controls:- Add AnomalyArmor’s IP addresses to the access level
- Or configure an access policy that allows the service account
Contact AnomalyArmor support for Enterprise VPC Service Controls integration options.
Troubleshooting
Permission denied / 403 error
Permission denied / 403 error
Causes:
- Service account lacks required roles
- API not enabled
- VPC Service Controls blocking access
- Verify roles: BigQuery Data Viewer and BigQuery Job User
- Enable BigQuery API in GCP Console
- Check VPC Service Controls perimeter settings
- Test service account access via gcloud CLI
Project not found
Project not found
Causes:
- Wrong project ID
- Project ID vs Project Name confusion
- Project deleted or suspended
- Use Project ID (lowercase with hyphens), not Project Name
- Verify project exists in GCP Console
- Check project hasn’t been deleted or suspended
Invalid service account JSON
Invalid service account JSON
Causes:
- Malformed JSON
- Missing required fields
- Copied text instead of file contents
- Download fresh key from GCP Console
- Paste entire file contents (including braces)
- Verify JSON is valid (no trailing commas, proper quotes)
BigQuery API not enabled
BigQuery API not enabled
Causes:
- API disabled in project
- New project without API enabled
- Go to GCP Console > APIs & Services > Library
- Search for “BigQuery API”
- Click Enable
- Wait a few minutes for propagation
Dataset not found
Dataset not found
Causes:
- Dataset was deleted
- Dataset in different project
- Permission to list datasets missing
- Verify dataset exists in BigQuery Console
- Check service account can list datasets
- Grant
bigquery.datasets.getpermission
No tables found in discovery
No tables found in discovery
Causes:
- Empty datasets
- Service account can’t read INFORMATION_SCHEMA
- Dataset-level permissions missing
- Verify tables exist in BigQuery Console
- Test query as service account
- Grant dataset-level access if using fine-grained permissions
Quota exceeded / Rate limit
Quota exceeded / Rate limit
Causes:
- Too many concurrent queries
- Project quota limits reached
- Wait and retry
- Check quota usage in GCP Console
- Request quota increase if needed
- Schedule discovery during off-peak hours
Best Practices
Use Dedicated Service Account
Create a dedicated service account for AnomalyArmor:- Easier to audit and manage permissions
- Can be rotated independently
- Clear separation of concerns
Start with Production Data
Monitor your production project first where schema changes have the most impact:Rotate Keys Periodically
Rotate service account keys on a regular schedule:- Create new key in GCP Console
- Update credentials in AnomalyArmor
- Delete old key after verification
Monitor Specific Datasets
If you have many datasets, consider creating dataset-level permissions to monitor only critical ones:Next Steps
Run Discovery
Scan your BigQuery project
Set Up Alerts
Get notified of schema changes
