Skip to main content
You can connect BigQuery in two ways: sign in with Google (Quick Connect), or use a service account. A service account is an identity that belongs to your Google Cloud project, not to a person, and you decide exactly which data it can reach. Available on every Markifact plan.

When to use a service account


Step 1: Create the service account

1

Create it

In the Google Cloud console, open IAM & Admin, then Service Accounts, select your project and click Create service account. Give it a name such as markifact.
2

Grant BigQuery Job User

In the permissions step, add the role BigQuery Job User. This lets it run queries. It does not give access to any data yet.
3

Finish

Skip the last step and click Done. Copy the service account’s email address, which looks like markifact@your-project.iam.gserviceaccount.com. You need it in the next step.

Step 2: Choose what data it can access

Pick one of the three levels. Data Viewer is read-only. Data Editor also lets Markifact create tables and insert rows.

Whole project

When you create the service account (or later in IAM & Admin, then IAM, then Grant access), add BigQuery Data Viewer or BigQuery Data Editor next to BigQuery Job User.

One dataset

  1. In BigQuery, find the dataset in the left panel and click the three dots next to its name.
  2. Click Share, then Manage permissions.
  3. Click Add principal and paste the service account’s email.
  4. Choose BigQuery Data Viewer (read only) or BigQuery Data Editor (read and write), then save.
Repeat for each dataset Markifact should reach. Or run this in the BigQuery editor:
Use roles/bigquery.dataEditor to also allow writes.

One table

  1. In BigQuery, find the table in the left panel and click the three dots next to its name.
  2. Click Share, then Manage permissions.
  3. Click Add principal and paste the service account’s email.
  4. Choose BigQuery Data Viewer, then save.
Or with SQL:
Table-level access works differently from dataset access:
  • Markifact can query the table and read its schema, but the dataset and table do not appear in the dataset and table lists. Type the full table name in your query, for example your-project.your_dataset.your_table.
  • It is read-only in practice. Insert Rows needs Data Editor on the dataset, not only on the table.
If you want Markifact to browse tables or write data, grant access on the dataset instead.

What works at each level


Step 3: Create a JSON key

  1. In Service Accounts, open your service account.
  2. Go to the Keys tab, click Add key, then Create new key.
  3. Choose JSON and click Create. A .json file downloads to your computer.

Step 4: Connect in Markifact

  1. Open Connections and click Connect next to BigQuery.
  2. Open the Service Account tab.
  3. Open the downloaded .json file in a text editor, copy all of it and paste it into the box.
  4. Click Save Connection. Markifact tests the key before saving.
The connection is named after the service account’s email. Connecting the same service account again with a new key replaces the old key.

Frequently asked questions

Yes, and this is the setup we recommend. Give the service account BigQuery Job User on the project, then BigQuery Data Viewer or Data Editor on that dataset only. Markifact then sees that dataset and nothing else in the project.
Yes, for reading. Grant BigQuery Data Viewer on the table. Markifact can query it and read its schema, but the table will not show up in dataset or table lists, so write its full name in the query. To insert rows, grant Data Editor on the dataset instead.
Use BigQuery Data Viewer everywhere and never grant Data Editor. Markifact can then query data, and Google refuses every attempt to create tables or insert rows.
No. BigQuery Job User on the project only lets it run queries. It cannot read any data until you grant Data Viewer or Data Editor on a project, a dataset or a table.
The service account has no dataset-level access. This is expected when you granted access on single tables only. Either grant Data Viewer on the dataset, or keep table-level access and type the full table name in your query.
Ask each client to create a service account in their own Google Cloud project, grant it access to the datasets they want to share, and send you the JSON key. Add one BigQuery connection per client in Markifact. Each connection only reaches that client’s data.
Queries run in the project you select in Markifact and are billed to that project by Google, the same as queries you run yourself.
Delete the key under Service Accounts, Keys, or remove the service account’s roles. Access stops immediately. Then delete the connection in Markifact.

Good to know

  • The key does not expire. It works until you delete it in Google Cloud. To rotate it, create a new key, connect again with it, then delete the old key.
  • Keep the file safe. Anyone with the key has the service account’s access. Delete the downloaded file once the connection is saved.
  • Key creation can be blocked. Some organizations turn off service account keys with a policy. If Create new key is unavailable, ask your Google Cloud admin or use Quick Connect.

Troubleshooting