# Connecting to Google BigQuery
Privacy Dynamics can connect to your Google BigQuery projects and datasets. This guide helps you authenticate and allow Privacy Dynamics to access your data through Google APIs.
To complete this guide, you will need the following:
- A BigQuery Project with at least one dataset.
- A Google Cloud Platform account and the privileges to create the service account (opens new window) with Data Editor and Job User permissions (opens new window).
- A unique service account JSON key generated from your Google Cloud Platform (see instructions below).
- A Privacy Dynamics account.
Before you can connect to a BigQuery project in Privacy Dynamics, it’s necessary to configure and download service account credentials.
# Configure BigQuery Authentication in Google Cloud Platform
There are three simple steps to perform in Google Cloud Platform. This provides Privacy Dynamics access to your specified BigQuery projects.
# Step 1: Create Credentials for a Service Account Using the API Manager
Sign in to your BigQuery account and then go to the Credentials page (opens new window) of the Google Cloud Platform API Manager.
Make sure you have selected the correct BigQuery Project (we are using the "Example Project").
Select +Create credentials and then select Service account.
# Step 2: Grant a Service Account Access to Your Project
Enter a name like "Privacy Dynamics Service Account" and then select Create and Continue.
Privacy Dynamics needs permissions to edit your dataset contents and run jobs using your project. Grant the Service Account both of these predefined roles (opens new window):
- BigQuery Data Editor
- BigQuery User
To limit our access to specific Datasets, the BigQuery Data Viewer or BigQuery Data Editor role can be granted on specific Datasets, instead of the entire Project.
Skip the optional user access step and select Done.
You should now see the new service account in the list at the bottom of the credentials page.
# Step 3: Create a Service Account Credential File (JSON)
In the Google Cloud Credentials page, select the address for the service account that you just created.
From your service account Details page, select the KEYS tab.
Select ADD KEY, then select Create new key.
Choose the JSON Key type and then select Create.
A JSON key file is downloaded to your computer. Select Close.
Warning: This file contains sensitive information. Save the JSON file in a secure location since this step is the only time GCP generates the key. You will upload the credential file in Privacy Dynamics in the next steps. You should then delete the key file.
# Add the BigQuery Connection in Privacy Dynamics
- Sign in to your Privacy Dynamics account.
- Go to the Connections page (opens new window).
- Select Add Connection.
- Choose BigQuery and select Next.
- Enter the connection details:
- Name - enter a name for you to identify the connection.
- Project ID - enter the ID of your BigQuery project.
- Dataset - enter the name of the project’s dataset you wish to anonymize.
- Upload File - use the Choose File dialog to upload the
.jsonService Account credential file you created earlier in this guide.
- Select TEST CONNECTION to verify the credentials.
- Select ADD CONNECTION and your connection saves if there are no errors.
- Delete the JSON key file from your machine.