2

I have a DataStudio dashboard which contains a dataset resource connection to a BigQuery table which is currently authenticated using an individual user's account.

I want to change that to use a service account.

In order to do that, I followed this guide, which means I have:

  1. Created a service account
  2. Added the BigQuery Job User role to the service account
  3. Added the Service Account Token Creator role to the service account
  4. Added the BigQuery Data Viewer role to the service account (associated to the correct BigQuery table)
  5. Ensured that my account is added as a Service Account User on the service account

On the DataStudio dashboard, I then navigate to:

Resource > Manage Added Data Sources > Select the specific data source > Click on the blade with the current user account being used to authenticate.

When I try to insert the service account details in the window, I see the error message below.

Adding service account to resource

I've followed the link (which leads back to the original guide). The link says I need to add the Service Account Token Creator to the service account, which I've confirm through the following:

enter image description here

Now I'm stumped! What could be the reason why I cannot authenticate the connection using the service account?

2
  • I found that it took me a while and multiple refreshes to get it to work. I also initially had to add the agent as a data viewer. After that I removed it and it still worked.
    – Avi
    Commented Aug 2, 2022 at 5:43
  • 1
    Thanks @Avi I'll try adding the data viewer role as well and give it another try. Commented Aug 2, 2022 at 11:02

1 Answer 1

5

I figured it out.

The problem was that the Service Account Token Creator role was assigned to the service account and not the service agent.

This link describes the process of setting up a service account for authenticating Data Studio data sources. Although it's got all the info there, the devil is in the detail in Step 2: Allow the Looker Studio service agent to access your service account.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.