Skip to content

Connecting to Google BigQuery (OAuth, JWT)

8 min read · Updated 4 Nov 2026

In this article, we’re going to show you how to connect your Astrato workspace to a data source in Google BigQuery.

Before you can set up your data connection, you’ll need the following:

  • Data connection: project and dataset names.

  • User account: Enter your username and password when asked. If you are using a Google account, when you log in, Google will prompt you to consent to Astrato accessing your Google Workspace.

  • Any user who uses the connection needs these permissions in BigQuery:

    • bigquery.jobs.create This permission allows creating and running query jobs on the project level. It is included in predefined roles such as BigQuery Job User.

    • bigquery.tables.get Data Permission on all tables and views referenced in the query grants read access to the data in those tables and views. It is included in the BigQuery Data Viewer role.

  • If using Service account authentication (JWT), you’ll need the JSON key you’ve created.

How to set necessary permissions in BigQuery

Section titled “How to set necessary permissions in BigQuery”

The best way is to use a Google Cloud service account to log in and make a safe connection to BigQuery.

  1. In the Google Cloud Console, navigate to the project where your BigQuery instance is located.

  2. Go to IAM & Admin → Service Accounts, then click Create Service Account.

Could not display content

  1. Click the Create and Continue button under the 1-step section to proceed with the service account setup.

  2. Grant the service account the following minimum set of permissions:

    1. BigQuery Connection Service Agent

    2. BigQuery Data Viewer

    3. BigQuery Job User

Could not display content

Click Done to complete the setup.

Creating a data connection to Google BigQuery

Section titled “Creating a data connection to Google BigQuery”
  1. Select Data & AI in the Astrato sidebar and go to the Data Connections tab. Click New connection to open the list of available sources, then select Google BigQuery.

Could not display content

  1. Under Authentication, choose an authentication method: Sign in with Google BigQuery (OAuth) or Service account (JWT).

Could not display content

OAuth - Allow Astrato permission to access external data

Section titled “OAuth - Allow Astrato permission to access external data”

You can use the default OAuth connection that your workspace provides or define your own.

Could not display content

  1. Under OAuth connection, choose the OAuth connection to use. The panel then shows whether you have already authorized it.

Could not display content

  • If the panel says “Already authorized. You can validate the connection directly.”, go on to enter the project and dataset.

  • Otherwise, select Sign in. The Google authentication page opens in a new window; select the account you want to use, review the required permissions, and click Continue.

Google “You’re signing back in to Astrato” sign-in page with Cancel and Continue buttons.

Google consent page “Astrato wants additional access to your Google Account”, offering to view and manage BigQuery data, with Continue.

These are the 3 services to which Astrato has access.

Google “Astrato has this access” dialog listing personal info, primary email address and association permissions, with a Done button.

  • While you sign in, the panel reads “Complete authorization in the sign-in window. This page will update automatically.” Once authorization succeeds, return to Astrato; there is nothing to confirm. Older versions of Astrato showed the confirmation dialog below instead.

Astrato confirmation dialog with a green check saying the Google BigQuery permissions have been granted, and an OK button.

OAuth - Enter data connection and project details

Section titled “OAuth - Enter data connection and project details”
  1. Under Connection details, choose a Project, then a Dataset from that project. Select a Deployment Region if your workspace offers one, then select Validate Connection.

  2. Under Name, review the Connection name, then select Save connection. When the panel shows Connection created, select Finish.

    The screenshot below shows the earlier version of this form, which used a Next button.

Connect to Google BigQuery form with OAuth selected, and Select Connection, Select your project and Select your dataset dropdowns above Next.

  1. The only thing to establish before you go to the Semantic Layer Editor in Astrato is to accept or modify access to the created data connection for Astrato users and/or groups. After Finish, the new connection’s properties open; use the Manage Access tab. The screenshot below shows the earlier Add Members dialog.
  • Add Members dialog with a search box and the options Visible to everyone (ticked), Viewer, Designer and Creator.

With the JWT authentication method, a Google Cloud service account is used to authenticate and establish a secure connection to BigQuery.

The JWT method is recommended for server-to-server integrations, as it avoids manual user authentication and ensures reliable, automated access to your BigQuery datasets.

The service account key will be used by Astrato to establish the connection with Google BigQuery.

  1. In the Google Cloud Console, go to IAM & Admin → Service Accounts.

  2. Select the service account created in the previous step.

  3. Navigate to the Keys tab, then click Add Key → Create New Key. Ensure the Key type is set to JSON.

Google Cloud “Create private key” dialog for a service account with Key type JSON selected and P12 as the alternative, plus Create.

The key file will be generated and automatically downloaded to your computer. Store this file securely, as it will be required for the Astrato connection

  1. Once you’ve selected Google BigQuery, choose Service account under Authentication. The screenshots in this section show the earlier version of the form, where this option was called JWT Token.
  • Connect to Google BigQuery form with the JWT Token authentication type selected, a Use dynamic connection checkbox, a Json key box and a dataset dropdown.

  1. Paste the contents of the JSON key file into Service account key. The key names its project, so there is no project to choose. Under Connection details, choose the Dataset, select a Deployment Region if your workspace offers one, then select Validate Connection.
  • Connect to Google BigQuery JWT Token form with Use dynamic connection ticked, the Json key pasted in, a project and the ASTRATO dataset selected, ready for Next.

  1. Under Name, set the Connection name, then select Save connection. When the panel shows Connection created, select Finish.
  • Connect to Google BigQuery step with the Data connection name field set to ASTRATO and a Next button.

  1. The only thing to establish before you go to the Semantic Layer Editor in Astrato is to accept or modify access to the created data connection for Astrato users and/or groups. After Finish, the new connection’s properties open; use the Manage Access tab. The screenshot below shows the earlier Add Members dialog.
  • Add Members dialog with a search box and a list showing Visible to everyone (checked), Viewer, Designer and Creator.

A dynamic data connection allows users to work on different projects using a single data model. This is especially useful when combined with embedded analytics for OEM solutions.

Setting up a dynamic data connection is similar to setting up a service account (JWT) connection. It is available with Service account authentication only; Sign in with Google BigQuery does not offer it. See Dynamic connections for how the settings work across sources. The screenshots below show the earlier version of these screens.

Follow these steps:

  1. Create a new Google BigQuery connection, choose Service account under Authentication, and tick Use dynamic connection.

    Connect to Google BigQuery form with JWT Token selected and the Use dynamic connection checkbox ticked and highlighted in red.

  2. Paste the default JSON key into Service account key. The project it names is the default project, used to build the data model and define measures and dimensions.

  3. Under Connection details, choose the Dataset. This part is not dynamic, and all users will use the same dataset.

    1. Connect to Google BigQuery form with dynamic connection ticked, a JSON key pasted, a project selected, the ASTRATO dataset chosen and Next enabled.

  4. Select Validate Connection.

  5. Under Name, give the data connection a Connection name, then select Save connection.

    1. Connect to Google BigQuery step with the Data connection name field set to ASTRATO and a Next button.

  6. The panel shows Connection created with a Dynamic connection settings section. Select Add dynamic connection settings, search for and choose a User (who must be part of the Astrato tenant), and paste that user’s JSON key into Service account key. The Project is filled in from the key. Select Save user settings, and repeat for each user.

    1. Add Dynamic Connection Settings screen with two users listed and a JSON key box, Use default value checkbox and Select your project field.

  7. Select Finish. You can add or change user settings later from the connection’s Dynamic connection tab.

  8. Define who has the right to use the connection, from the connection’s Manage Access tab.

    1. Add Members screen with a user list and a Selected panel showing the resource owner and administrators, with a Connect button.

  • Only users who use the same JWT key and project as the defaults will be able to edit and see the data in the Semantic Layer Editor

  • The dynamic data connection is only used in published workbooks.

  • Users who aren’t defined in the dynamic connection table won’t be able to see data in the workbook.

Next steps > Using the Semantic Layer Editor …