An Azure connection starts in Microsoft Entra ID rather than in BigQuery. You register an application there, create the BigQuery connection that points at it, then give the application a federated credential and read access to the storage account. After that you can query files in Azure Blob Storage with SQL.
This guide covers the cross-cloud connection described in Google’s cross-cloud connections documentation. For the background, see our overview of what cross-cloud connections are.
Prerequisites
You will need the following in place:
- BigQuery permissions: The roles/bigquery.admin role on the Google Cloud project, or a custom role with equivalent permissions.
- Azure permissions: A role that can manage app registrations in Microsoft Entra ID and assign roles on the storage account. Google’s Blob Storage page lists the tenant permissions Application.ReadWrite.All and AppRoleAssignment.ReadWrite.All. The role assignment needs Microsoft.Authorization/roleAssignments/write.
- A storage account: A general-purpose v2 or Blob Storage account with hierarchical namespace enabled, holding data in a supported format such as Parquet or CSV.
- A BigQuery location: A standard location. Pick the closest one to your Azure region. For example, Azure UK South maps to europe-west2 and Azure West Europe maps to europe-west4. Unlike Google’s standard BigQuery Omni path for Azure, which supports only azure-eastus2, a cross-cloud connection uses standard BigQuery locations. Use the placeholders below throughout: TENANT_ID, APP_ID, PROJECT_ID, LOCATION, CONNECTION_ID, STORAGE_ACCOUNT_NAME, RESOURCE_GROUP_NAME and SUBSCRIPTION_ID.
Create an Application in Your Azure Tenant
- In the Azure portal, open App registrations and choose New registration.
- Enter a name, for example bigquery-cross-cloud.
- Set Supported account types to Accounts in this organisational directory only.
- Choose Register.
- Note the Application (client) ID and the Directory (tenant) ID. They become APP_ID and TENANT_ID.
Create the Connection in BigQuery
Console
- Open the BigQuery page and expand your project in Explorer.
- Expand Connections and choose Create connection.
- Set Connection type to BigLake on Azure (via BigQuery Omni).
- Enter a Connection ID.
- Set Region to your standard BigQuery location.
- Enter the Azure tenant ID.
- Tick Use federated identity.
- Enter the Azure federated application (client) ID.
- Optionally tick Enable cross-cloud caching. It is off by default.
- Choose Create connection, then Go to connection.
- In the Connection info pane, copy the BigQuery Google identity.
bq
bq mk --connection \
--connection_type='Azure' \
--tenant_id=TENANT_ID \
--location=LOCATION \
--federated_azure=true \
--federated_app_client_id=APP_ID \
--project_id=PROJECT_ID \
--properties='{"crossCloudCacheOptions":{"enabled":false}}' \
CONNECTION_ID
Then read the identity back:
bq show --connection \
--location=LOCATION \
PROJECT_ID.LOCATION.CONNECTION_ID
Copy the identity value from the output. Set the cache option to true if you want caching on.
Add a Federated Credential
The federated credential tells Azure to trust the BigQuery identity.
- In the Azure portal, open App registrations and select your application.
- Go to Certificates & secrets, then Federated credentials, then Add credential.
- Set Federated credential scenario to Other issuer.
- Set Issuer to
https://accounts.google.com. - Set Subject identifier to the BigQuery Google identity from Step 2.
- Enter a name and choose Add.
Give the Application Access to the Storage Account
The application needs a role on the storage account or container. Use Storage Blob Data Reader for read-only access. Use Storage Blob Data Contributor only if you also need to write. In the Azure portal, open the storage account, choose Access Control (IAM), then Add role assignment. Pick the role, set Assign access to to User, group, or service principal, select your application and save. With the Azure CLI, the same assignment looks like this. SP_ID is the object ID of the application’s service principal.
az role assignment create --role "Storage Blob Data Reader" \
--assignee-object-id SP_ID \
--assignee-principal-type ServicePrincipal \
--scope /subscriptions/SUBSCRIPTION_ID/resourcegroups/RESOURCE_GROUP_NAME/providers/Microsoft.Storage/storageAccounts/STORAGE_ACCOUNT_NAME
Role assignments can take a little time to apply. If you see a permission error straight away, wait and retry.
Query the Data
Create a dataset in the same BigQuery location, then an external table that uses the connection. These examples are adapted from Google’s own documentation.
CREATE SCHEMA `my-project.azure_raw_data`
OPTIONS (
location = 'us-east4');
CREATE EXTERNAL TABLE `my-project.azure_raw_data.sales_parquet`
WITH CONNECTION `us-east4.my-azure-connection`
OPTIONS (
format = 'PARQUET',
uris = ['azure://mystorageaccount.blob.core.windows.net/mycontainer/sales/year=2025/*']);
For CSV files, skip the header row:
CREATE EXTERNAL TABLE `my-project.azure_raw_data.daily_logs_csv`
WITH CONNECTION `us-east4.my-azure-connection`
OPTIONS (
format = 'CSV',
skip_leading_rows = 1,
uris = ['azure://mystorageaccount.blob.core.windows.net/mycontainer/logs/*.csv']);
Query either table as normal:
SELECT *
FROM `my-project.azure_raw_data.sales_parquet`
LIMIT 10;
Share the Connection
In the Google Cloud console, open the connection under Connections, choose Share, and add the people or groups who need access. Give them roles/bigquery.connectionUser to query through it. Only give roles/bigquery.connectionAdmin to people who manage it. Deleting the connection deletes the Google identity used to reach the Azure application. The Azure application itself is not deleted, so remove it in Azure if you no longer need it.
Troubleshooting
- Application rejects the connection: Check that the tenant ID and the federated application (client) ID on the connection match the values in Azure, and that the federated credential uses the BigQuery identity. Wait a few minutes after any change.
- Access denied reading from Blob Storage: The application needs a role such as Storage Blob Data Reader on the storage account or container.
- Not found: Check the account, container and path in uris for spelling.
Newsletter
Occasional notes on data, tracking & AI-readiness
No spam, no growth-hacking. Just an email when there's something worth reading.