Skip to content

Set up the BigQuery environment

The BigQuery connector allows you to access the BigQuery REST API from an integration sequence.

To work with the BigQuery connector, you need to have a Google Cloud Platform account. If you do not have a Google Cloud Platform account, go to console.cloud.google.com, and create a Google Cloud Platform trial account.

BigQuery uses the OAuth 2.0 protocol for authorization. All requests to the BigQuery REST API will be authorized against a registered user. Developers can generate user credentials from the Google Cloud Platform using two different mechanisms. See the following sections for details.

Obtain user credentials

Follow the steps below to generate user credentials.

Obtaining a client ID and client secret

  1. Go to https://accounts.google.com/SignUphttps://accounts.google.com/SignUp and create a Google account.

  2. Go to https://console.developers.google.com/projectselector/apis/credentials, and sign in to your Google account.

    Bigquery-credentials-page

  3. If you do not already have a project, Enter BigQueryExample as the name of the project and click on Create.

  4. To create an api key, Click on Create credentials and then select API key.

    Select OAuth client ID

  5. Click on the Configure consent screen in the next screen.

    Bigquery-credentials-page

  6. Provide the Application Name as BigQueryExample, and provide your email as User support email and email address of Developer contact information in the Consent Screen, then click on SAVE AND CONTINUE.

  7. To add scopes for API, click on ADD OR REMOVE SCOPES

    1. Go to Google API Library.

      Consent Screen

    2. Search BigQuery API and enable it.

      Consent Screen

    3. Refresh the page and add following scopes.

      Consent Screen

  8. Click on ADD USERS, type the email address of the account you will be testing with, then click on SAVE AND CONTINUE.

    Consent Screen

  9. To get client id and client secrets, Click on Create credentials and then select OAuth client ID.

    Select OAuth client ID

  10. Next, select Web Application, and create a client.

    Select web application

  11. Add https://developers.google.com/oauthplayground as the redirect URI (you can add any URI that you need as redirect URI) under Authorized redirect URIs, and then click Create. This displays the client ID and client secret.

    Authorization-redirect-URI

  12. Make a note of the client ID and client secret that is displayed or download the json file, and then click OK.

Obtain access token and refresh token

  1. Navigate to OAuth 2.0 Playground and click OAuth 2.0 Configuration button in the Right top corner.

  2. Select Use your own OAuth credentials, and provide the obtained Client ID and Client Secret values as above click on Close.

    Obtaining Oauth-configuration

  3. Under Step 1, select BigQuery API v2 from the list of APIs, select the following scopes.

    Selecting Scopes

  4. Click on Authorize APIs button and select your Gmail account when you are asked and allow the scopes.

    Grant Permission

  5. Under Step 2, click Exchange authorization code for tokens to generate and display the Access Token and Refresh Token.

Obtain credentials using the service account

  1. Open the Service Accounts page in the GCP console.

    Bigquery service account

  2. Select your project and click Open.

  3. Click Create Service Account.

    Bigquery create service account

  4. Enter Service account details, and then click CREATE AND CONTINUE.

    Bigquery enter service account

  5. Select a role you wish to grant to the service account and click CONTINUE.

    Bigquery enter service account role

  6. Grant users access to this service account (optional) and click Done.

    Bigquery enter service account grant user access

  7. Go to the service account for which you wish to create a key and click on the created Service account in that row.

    Bigquery enter service account grant user access

  8. Click on Create key.

    Bigquery service account create key

  9. Select the key type as P12 and click Create. Then the created key will be downloaded.

Create dataset and table

Create dataset

  1. Open the BigQuery console and select the created project

    Bigquery create Dataset step1

  2. Click on the View Action on the created project.

    Bigquery create Dataset step2

  3. Enter the required Dataset details and click Create Dataset.

    Bigquery create Dataset step2

Create table

  1. After creating the Dataset, click on the created Dataset. You can see the following details. Then click Create Table.

    Bigquery create Table step1

  2. Enter required Table details and click Create.

    Bigquery create Table step2

For more information about these operations, please refer to the BigQuery connector reference guide.