The Simplest Way to Make BigQuery and Microsoft AKS Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use bigquery and microsoft aks together to run apps that query cloud data. Your containers run in Azure while your data warehouse stays in Google Cloud. This cross-cloud setup lets developers build fast data tools where the compute already lives. Still, linking two cloud providers brings real risks around keys, roles, and logs. Without a clear plan, teams end up with static keys scattered across clusters. Good access rules keep both platforms safe and easy to run. How bigquery and micro

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 use bigquery and microsoft aks together to run apps that query cloud data. Your containers run in Azure while your data warehouse stays in Google Cloud.

This cross-cloud setup lets developers build fast data tools where the compute already lives. Still, linking two cloud providers brings real risks around keys, roles, and logs. Without a clear plan, teams end up with static keys scattered across clusters. Good access rules keep both platforms safe and easy to run.

How bigquery and microsoft aks share identity and data

Workloads in your cluster need a safe way to read and write data tables. Each pod must prove its identity to Google Cloud before running any query. The best path links your Azure workload identity with Google Cloud identity federation. This setup trades a cluster token for a temporary Google Cloud token at runtime. Your app then sends queries over HTTPS and reads the table results back.

Inside the cluster, Kubernetes RBAC controls which pods can use that linked service account. A Role sets permissions within one namespace, while a ClusterRole works across the cluster. Kubernetes permissions are additive, which means there are no deny rules in RBAC. You bind a Role to a specific namespace with a RoleBinding to limit scope. On the Google Cloud side, IAM roles control which datasets that identity can read.

Data flows straight from the warehouse API to the pod over encrypted network links. You should keep both the cluster and the dataset in nearby regions for speed. Cross-cloud traffic costs money and adds wait time if regions sit far apart. Fast apps pull only the rows they need instead of full raw tables.

Common failure modes and how to scope roles

The biggest mistake is putting a static Google JSON key inside a cluster secret. If someone steals that key, they can query your data from anywhere on earth. Shared service accounts create another big problem for security and operations teams. When ten apps share one account, your logs cannot show which app ran a query. Broad cluster roles also let engineers open shells into pods and take cloud tokens.

In Kubernetes RBAC, pod logs and pod exec are subresources written with a slash. If a user has permission on the exec subresource, they can run commands inside pods. From inside a running pod, an engineer could use the pod identity to query tables. You should limit exec permissions and scope every RoleBinding to a single namespace. Give each workload its own service account on both clouds with read-only table permissions.

Microsoft Entra ID (Azure AD) + BigQuery IAM: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Human access needs the same care as app access across both cloud platforms. Engineers often debug data bugs by running test queries from a cluster pod. When they use the pod identity, the warehouse log only shows the service account. You lose track of which person ran the query or viewed customer rows. Masking rules can also rewrite sensitive fields like emails, phone numbers, or card numbers.

Setting up safe network and audit rules

Network rules should restrict which pods can talk to external cloud data endpoints. Most clusters allow all outbound traffic from every namespace by default. You can add network policies so only approved data pods reach Google Cloud APIs. This stops a broken web pod from talking to your data warehouse at all.

Audit logs on both sides help your team spot strange queries or role changes. Turn on API server audit logs in your cluster to track role bindings. Check your warehouse job history to see how much data each service account scans. Set billing alerts and query quotas so one bad loop cannot drain your budget.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Should we store Google Cloud JSON keys in Kubernetes Secrets?

No, static JSON keys never expire by default and are easy to leak. Use workload identity federation so pods get short-lived tokens without storing long-term keys.

How do we stop pods in other namespaces from querying our tables?

Create a dedicated Kubernetes service account in one namespace and bind it with a RoleBinding. Link only that single namespace and service account to the Google Cloud IAM role.

Why do our warehouse logs show a service account instead of a user name?

When engineers run queries from inside a pod, the request uses the pod identity. Have engineers run queries with their own user accounts instead of shared pod shells.

The query runs. The emails stay hidden.