How to set up Google BigQuery in a ListenBrainz development environment?

Hi!

I am trying to set up Google BigQuery in my development environment, to test a statistic I wrote. However, there is no documentation to do this and the Google BigQuery documentation is targeted more if you are a developer implementing it in an application.

There is the bigquery-credentials.json file in the project, which looks like this.

{{- define "KEY" -}}
    {{ key (printf "docker-server-configs/LB/bigquery-credentials.json/%s" .) }}
{{- end -}}
{
  "type": "{{template "KEY" "type"}}",
  "project_id": "{{template "KEY" "project_id"}}",
  "private_key_id": "{{template "KEY" "private_key_id"}}",
  "private_key": "{{template "KEY" "private_key"}}",
  "client_email": "{{template "KEY" "client_email"}}",
  "client_id": "{{template "KEY" "client_id"}}",
  "auth_uri": "{{template "KEY" "auth_uri"}}",
  "token_uri": "{{template "KEY" "token_uri"}}",
  "auth_provider_x509_cert_url": "{{template "KEY" "auth_provider_x509_cert_url"}}",
  "client_x509_cert_url": "{{template "KEY" "client_x509_cert_url"}}"
}

Some of these things I recognize from the Google Cloud console, like project_id, but I’m in the dark on how to configure the rest of these.

Could someone explain what I need to do to get this working, or where to find some of this information in the Google Cloud Platform console? If someone can explain it, I’ll write a piece of documentation and submit this back to the project to help others.

1 Like

You want the json file described at the following documentation: https://developers.google.com/identity/protocols/application-default-credentials#howtheywork

1 Like

The file you’re looking at was the consul template MeB uses in production to create our own BigQuery credentials. What you should do is find the JSON file alastair linked.