How to Integrate Power BI and Spanner Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair Power BI and Spanner to build live reports from distributed databases. This setup lets analysts run queries and chart business metrics in real time. Linking a business reporting app to a core database carries clear security risks. You must protect sensitive records while giving analysts the data they need. Good access rules keep your database fast, safe, and easy to audit. How data flows between Power BI and Spanner Power BI needs a driver or connector to read tables inside Spanne

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams pair Power BI and Spanner to build live reports from distributed databases. This setup lets analysts run queries and chart business metrics in real time.

Linking a business reporting app to a core database carries clear security risks. You must protect sensitive records while giving analysts the data they need. Good access rules keep your database fast, safe, and easy to audit.

How data flows between Power BI and Spanner

Power BI needs a driver or connector to read tables inside Spanner. The reporting tool sends read queries over an encrypted network link. Spanner processes the query and returns the result rows to the dashboard.

Analysts can choose between two main ways to pull this data. They can import a scheduled copy of the data into Power BI. They can also run live queries every time a user opens a report.

To make this work, Power BI must log in to Google Cloud. Teams often use a Google Cloud service account key for this login step. That account holds a specific cloud role that grants permission to read tables.

Common risks with shared accounts and broad permissions

Many teams use one static service account key for all Power BI reports. If someone leaks that key, an attacker can read your entire database. Shared keys also ruin your audit logs during a security review.

When five analysts share one account, every query looks the same in the logs. You cannot tell which person ran a slow or risky query. You also cannot revoke access for one person without breaking every dashboard.

Overbroad roles create another big risk for your production database. A role with write access lets a bad query change or delete data. Even read access across all tables exposes private customer records to too many people.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unchecked live queries can also hurt your database speed and drive up costs. A complex dashboard refresh can use too much compute power on your nodes. This load can slow down the main apps that serve your users.

Scoping roles and network paths for safe reporting

Start by creating a dedicated, read-only database role just for reporting. Grant this role permission to read only the specific tables needed for charts. Never give your reporting tool permission to write, update, or drop tables.

Use fine-grained access controls to restrict which rows and columns the role sees. Keep raw emails, phone numbers, card numbers, and national IDs out of general reports. If analysts need those tables, masking rewrites matched fields in results to protect privacy.

Lock down the network path between the reporting service and your cloud project. Use private network links or strict firewall rules to block public traffic. Only allow traffic from known report server addresses to reach the database port.

Replace long-lived JSON key files with short-lived credentials whenever your setup allows it. Rotate keys on a set schedule and watch your cloud logs for odd queries. Set query timeouts so a bad report cannot lock up database compute resources.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should we use live queries or scheduled imports for Spanner data?

Use scheduled imports for most dashboards to keep database load low and predictable. Save live queries for operational reports that truly need up-to-the-minute numbers.

How do we stop Power BI from reading sensitive customer columns?

Create restricted database views or use column-level security in your database role. You can also apply data masking so queries return redacted emails and card numbers.

Why are shared service account keys bad for BI tools?

Shared keys hide individual user activity in your logs and never expire on their own. If a shared key leaks, you must update every single report to fix it.

The query runs. The emails stay hidden.