How to Query BigQuery From an Application on AWS or Azure (2026): Three Ways to Authenticate and Read Results
With BigQuery cross-cloud connections now generally available as of November 25, 2026, BigQuery can query data that lives in AWS, Azure, and Salesforce Data 360 from all BigQuery regions. If your application runs on AWS
With BigQuery cross-cloud connections now generally available as of November 25, 2026, BigQuery can query data that lives in AWS, Azure, and Salesforce Data 360 from all BigQuery regions. If your application runs on AWS or Azure and needs to call BigQuery, you face three practical decisions: how the workload authenticates, which network path it takes, and how it reads large result sets. The short answer is to use short-lived credentials through Control Plane’s Universal Cloud Identity or Workload Identity Federation. Call BigQuery over the public API, or over Private Service Connect if policy requires private connectivity, and pull large results through the Storage Read API.
Disclosure: Control Plane publishes this guide.
TL;DR
Use federated, short-lived credentials and the right read path for the size of your result set.
- Avoid service account keys. Google warns that to attackers they can be even more valuable than a leaked password.
- Control Plane’s Universal Cloud Identity creates the Google service account in your GCP account and serves short-lived credentials to an unmodified SDK, with no long-lived cloud keys in your code.
- Workload Identity Federation exchanges your AWS or Azure environment credentials for short-lived Google tokens with no private key on disk.
- Pick the network path by data volume and privacy requirements, from the public TLS endpoint up to Cross-Cloud Interconnect.
- Use the BigQuery Storage Read API for large result sets. It streams data in parallel in Avro or Arrow format.
- Storage Read API results leaving Google Cloud are billed as network usage on the Google side. Inbound transfer to Azure is free, AWS lists inbound transfer as its own line on the EC2 pricing page, and a NAT gateway in the receiving path bills per GB processed.
The companion post covers BigQuery cross-cloud connections reaching GA.
How do you query BigQuery from an application on AWS or Azure?
Your application authenticates with a Google Cloud principal, calls the BigQuery API over HTTPS, and reads results through either the REST paging interface or the Storage Read API.
| Question | Control Plane Universal Cloud Identity | Workload Identity Federation | Service account key |
|---|---|---|---|
| What sits with the app | No key file. Control Plane serves the cloud provider’s own instance metadata endpoint inside the workload, so the SDK finds short-lived credentials where it already looks. | A credential configuration file (no private key). | A JSON key file containing a private key. |
| Credential the app uses | Short-lived access token served by the metadata endpoint. | Short-lived federated token from Google’s Security Token Service. | Long-lived RSA private key. |
| One-time setup | A GCP cloud account where Control Plane’s GCP service account holds Viewer, Project IAM Admin, Service Account Admin, Service Account Token Creator, and BigQuery Admin, then a GCP block on the identity. | A workload identity pool and provider per AWS account or Azure Entra ID tenant, plus a credential configuration file. | Create and download the key, store it securely, rotate it on a schedule. |
| Who creates the Google principal | Control Plane creates a service account in your GCP account with the minimum permissions required to access the targeted services, or attaches to an existing one you name. | You grant the federated principal access directly, or designate a service account for it to impersonate. | You create the service account and download its key. |
| App code change | None. The SDK finds credentials where it already looks. | None. ADC reads the credential configuration file automatically. | None if the SDK reads the key file through ADC. |
| Key exposure | No service account key reaches the app. Control Plane obtains temporary access tokens that impersonate a standard GCP service account. | No key. Google recommends it to avoid the risks of long-lived keys. | Keys are powerful credentials that are a security risk if not managed correctly. Google recommends avoiding user-managed keys whenever possible. |
| Where the app can run | Any location in the workload’s Global Virtual Cloud (GVC), Control Plane’s named set of locations: AWS, GCP, Azure, and Oracle Cloud Infrastructure regions, plus clusters you registered or your own hardware. One identity can also call AWS and Azure services. | AWS or Azure (EC2, EKS, Azure VMs, AKS). | Anywhere the key file can be stored. |
A workload that reads from S3 and writes to BigQuery needs only one Control Plane identity because a single identity can carry AWS, GCP, and Azure cloud blocks. Workload Identity Federation requires a separate pool or provider per cloud, and a service account key is cloud-agnostic but introduces the risk of credential leakage, privilege escalation, information disclosure, and actions that are hard to attribute. Organizations created on or after May 3, 2024 enforce the key-creation constraints by default, and older organizations can enforce them through organization policy.
How do you set up Workload Identity Federation for AWS?
Workload Identity Federation with AWS lets an EC2 instance exchange its IAM role credentials for a short-lived Google token with no service account key on disk, and EKS pods use the Kubernetes path covered in the FAQ.
- Create a workload identity pool in your Google Cloud project to manage external identities.
- Add an AWS provider to the pool. This uses the AWS IAM credentials mechanism: Google verifies the instance’s temporary credentials with the AWS GetCallerIdentity API, and no AWS-side configuration change is needed beyond the instance’s attached IAM role. Google also supports AWS outbound identity federation, where AWS acts as an OIDC identity provider issuing short-lived JWTs, through an OIDC provider instead. For instances with an attached role, Google’s example attribute mapping adds
attribute.aws_role, so access can be granted to every instance in that role. - Grant the federated principal BigQuery Job User on the project that runs queries, BigQuery Data Viewer on the datasets it reads, and BigQuery Read Session User if it uses the Storage Read API. Google recommends granting direct resource access to the federated principal; service account impersonation is needed only where an API has a limitation, and BigQuery’s Google Cloud API has no known limitations with federation.
- Generate a credential configuration file by running
gcloud iam workload-identity-pools create-cred-configwith the--awsflag, and optionally--sts-locationfor a regional Security Token Service endpoint. On EC2 instances that use IMDSv2, add--enable-imdsv2. The resulting file holds no private key and does not need to be kept confidential. - Set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to the path of that file. The BigQuery client libraries use Application Default Credentials, and ADC reads the credential configuration file to perform the token exchange automatically.
How do you set up Workload Identity Federation for Azure?
Azure workloads exchange a Microsoft Entra ID token for a short-lived Google Security Token Service token, but the Entra ID setup carries a security caveat.
- Register an application in Microsoft Entra ID and assign a managed identity to the Azure VM or resource that runs the workload.
- Google cautions that with Azure’s default settings, the new application lets all users in the tenant obtain access tokens. Restrict the application’s assignment to the specific managed identity or user group before proceeding.
- Create a workload identity pool and add an OpenID Connect (OIDC) provider with the issuer URL
https://sts.windows.net/TENANT_IDand the application ID URI as the allowed audience. - Grant the federated principal the same BigQuery roles described for AWS: Job User on the project, Data Viewer on the datasets, and Read Session User for the Storage Read API.
- Generate a credential configuration file with
gcloud iam workload-identity-pools create-cred-configusing the Azure flag and the application ID URI. SetGOOGLE_APPLICATION_CREDENTIALSto the file path. The Cloud Client Libraries, the gcloud CLI, and Terraform perform the exchange automatically.
How does Control Plane’s Universal Cloud Identity reach BigQuery?
Control Plane’s Universal Cloud Identity gives a workload a GCP service account with no long-lived cloud keys in your code, and the SDK picks up its credentials from a metadata endpoint inside the workload.
- Connect a GCP cloud account to Control Plane. Your GCP administrator adds Control Plane’s GCP service account (
[email protected]) as a member of your GCP account with four roles: Viewer, Project IAM Admin, Service Account Admin, and Service Account Token Creator. Because the identity connects with BigQuery, that service account also needs the BigQuery Admin role, which lets Control Plane grant a temporary access token to the workload. - Create an identity with a GCP cloud block. Either list role bindings, and Control Plane creates a service account in your GCP account with the minimum permissions required to access the targeted services, or name an existing service account. For BigQuery, bind
roles/bigquery.jobUserandroles/bigquery.dataVieweron the project, plusroles/bigquery.readSessionUserif the workload uses the Storage Read API. - Assign the identity to the workload, and allow outbound traffic to
bigquery.googleapis.com(plusbigquerystorage.googleapis.comfor the Storage Read API) in the workload’s external firewall, because a new workload’s outbound requests are disabled by default. A workload has exactly one identity, and identities are scoped to a GVC. Because a GVC can span locations on AWS, GCP, Azure, and Oracle Cloud Infrastructure, plus clusters or servers you run, the same BigQuery access works from every location. - The SDK reads short-lived credentials from the instance metadata endpoint that Control Plane serves inside the workload. No code change is needed. Control Plane obtains a temporary access token that impersonates the service account and serves it where the SDK already looks. Each cloud block on the identity reports whether it is usable and carries the last error if it is not, which is where a refused role creation surfaces.
The one-identity model across clouds covers how a single identity maps to each provider.
Which network path should the application use?
The right path depends on data volume, latency requirements, and whether your security policy requires private connectivity.
| Path | What it needs | When to use it |
|---|---|---|
| Public API endpoint over TLS | Nothing beyond outbound HTTPS from the workload. | Most workloads. BigQuery APIs are public Google API endpoints over TLS, and this is the simplest option. |
| Private Service Connect for Google APIs over Cloud VPN or Cloud Interconnect | A Private Service Connect endpoint that gives BigQuery an internal IP address, plus Cloud VPN or Cloud Interconnect from your AWS or Azure VPC to the Google VPC, a Cloud Router route advertisement for the endpoint, and DNS names that resolve the BigQuery API hostnames to it. | When policy requires BigQuery traffic to use internal IP addresses. Cloud Interconnect keeps that traffic off the public internet; Cloud VPN encrypts it with IPsec between gateways that use external IP addresses. |
| Cross-Cloud Interconnect | Dedicated high-bandwidth links between Google Cloud and AWS, Azure, Oracle Cloud Infrastructure, or Alibaba Cloud, plus a Private Service Connect endpoint to reach BigQuery at an internal IP address. | High-volume, low-latency workloads that justify dedicated capacity. |
| Partner Cross-Cloud Interconnect | A managed interconnect option. Available for AWS; Azure is in Preview. Google handles redundancy at the service level. | When you want dedicated bandwidth without managing the physical interconnect yourself. |
On Control Plane, the same workload that calls BigQuery can also reach private databases and services. Cloud Wormhole, Control Plane’s private network access, connects workloads to TCP or UDP endpoints in VPCs, on-premises data centers, and other private networks through an agent that connects out to Control Plane, so the private network needs only outbound access. From a Control Plane workload, BigQuery API calls go to the public endpoint over TLS once the workload’s outbound firewall allows the BigQuery hostnames.
How do you read large result sets efficiently?
The choice between REST paging and the Storage Read API determines throughput, format flexibility, and cost.
| Method | Best for | Format | Billing model |
|---|---|---|---|
| jobs.getQueryResults or tabledata.list | Small result sets where simplicity matters. Returns paginated JSON rows. | JSON | No separate read charge listed on the BigQuery pricing page. |
| Storage Read API ReadRows | Large result sets that benefit from parallel streaming, column projection, server-side filter predicates, and snapshot consistency. Can stream query results directly (the Arrow query-results path is in Preview). | Avro or Arrow | On-demand by bytes read. Bytes read from temporary tables are not charged, but network usage still applies. The free tier does not cover outbound data transfer. |
The Storage Read API is enabled wherever the BigQuery API is enabled and requires the Read Session User role. It supports multiple parallel streams, so a multi-threaded application can read disjoint sets of rows at once. If you are still using the v1beta1 Storage API, migrate to v1. Since November 20, 2026, only projects that used v1beta1 between March 1 and August 31, 2026 can call it, and Google shuts it down on August 31, 2027.
Who pays for data transfer?
Bytes flow out of Google Cloud when an AWS or Azure application reads BigQuery results, and for the Storage Read API Google publishes that outbound transfer as a network-usage charge on the Google Cloud bill.
For the Storage Read API, Google bills network usage; data transfer in is free. The BigQuery pricing page lists that network usage charge only for the Storage Read API, and when you use Interconnect, Cloud Interconnect pricing applies instead of the Storage Read API’s network usage rates. On the receiving side, Azure states that inbound data transfer is free, and AWS lists inbound transfer as its own line on the EC2 pricing page. A NAT gateway in the receiving path adds a charge: AWS bills data processing for each gigabyte through a NAT gateway regardless of direction, and Azure NAT Gateway charges per GB for outbound and return traffic. Minimizing transferred bytes through column projection, row filtering, and partitioned tables reduces cost on every path.
How Control Plane fits
Control Plane handles Day 2 operations for you, including autoscaling, built-in observability, and security. Universal Cloud Identity removes the need to manage service account keys or configure Workload Identity Federation pools yourself. You define the BigQuery roles on the identity, assign it to the workload, and the SDK picks up short-lived credentials automatically. Control Plane’s docs list BigQuery on GCP among the services workloads reach through Universal Cloud Identity without embedding credentials. Control Plane also stores a GCP service account key as a gcp secret if you need one, but Universal Cloud Identity keeps any key out of the workload. Control Plane offers a 99.999% SLA for workloads that run at least two replicas in at least two locations.
FAQ
Common questions from platform and backend engineers connecting AWS or Azure applications to BigQuery.
How do I call BigQuery from AWS without a service account key?
Use Control Plane’s Universal Cloud Identity, which creates the Google service account and serves short-lived credentials to an unmodified SDK with no long-lived cloud keys in your code. You can also set up Workload Identity Federation with an AWS provider so your EC2 instance exchanges its IAM role credentials for a short-lived Google token. On EKS, register the cluster’s OIDC issuer as a provider and exchange the pod’s projected service account token instead.
Can an Azure VM authenticate to BigQuery with a managed identity?
Yes. Assign a managed identity to the VM, register an application in Microsoft Entra ID, create a workload identity pool with an OIDC provider for your Entra ID tenant in Google Cloud, and generate a credential configuration file. The BigQuery client library exchanges the managed identity token for a short-lived Google token through ADC.
Does Workload Identity Federation work with EKS and AKS?
Yes. EKS and AKS workloads follow Google’s Kubernetes federation guide. Register the cluster’s OIDC issuer URL as a provider in the workload identity pool (AKS needs the OIDC issuer feature enabled; EKS needs no configuration change), then mount a projected service account token with the provider as its audience. ADC exchanges that token for a short-lived Google token.
Do I need Cross-Cloud Interconnect to query BigQuery from AWS?
No. BigQuery exposes a public HTTPS API endpoint, so any workload with outbound internet access can call it. Cross-Cloud Interconnect is useful when you need dedicated high-bandwidth links or when policy prohibits public internet traffic.
What is the fastest way to read a large BigQuery result into an application?
Use the Storage Read API with multiple parallel ReadRows streams in Arrow or Avro format. It supports column projection and server-side filtering, which reduce the bytes transferred. The REST paging methods (jobs.getQueryResults and tabledata.list) are better suited to small result sets.
Who pays egress when an AWS application reads BigQuery results?
For the Storage Read API, Google Cloud bills outbound network usage because bytes leave Google’s network; data transfer in is free. Azure inbound is free, AWS lists inbound transfer as its own line on the EC2 pricing page, and a NAT gateway on the receiving side bills per GB processed.
How does Control Plane give a workload access to BigQuery?
You connect a GCP cloud account where Control Plane’s GCP service account holds Viewer, Project IAM Admin, Service Account Admin, Service Account Token Creator, and BigQuery Admin. Then you create an identity with a GCP cloud block that binds BigQuery Job User and BigQuery Data Viewer, assign that identity to the workload, and allow outbound traffic to the BigQuery API hostnames in the workload’s firewall. Control Plane creates a service account in your GCP project, obtains a temporary access token, and serves it through a metadata endpoint so the SDK finds short-lived credentials where it already looks. One identity can cover AWS, GCP, and Azure, and it works from every location in the GVC.
Can one identity access both AWS and Google Cloud resources?
Yes. A Control Plane identity can carry AWS, GCP, and Azure cloud blocks simultaneously. A workload that reads from S3 and writes to BigQuery uses one identity with an AWS block and a GCP block.
Is the BigQuery Storage Read API v1beta1 still supported?
It is deprecated. Since November 20, 2026, only projects that recorded v1beta1 usage between March 1 and August 31, 2026 can call it, and Google shuts it down on August 31, 2027. Migrate to the v1 Storage Read API, which is backward-compatible.
Talk to the Control Plane team to see how Universal Cloud Identity and multi-cloud workload orchestration work in practice, or sign up free to try it yourself.
Originally published on the Control Plane blog.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.