# Can DBT connect to BigQuery using Workload Identity?

**URL:** <https://discourse.getdbt.com/t/can-dbt-connect-to-bigquery-using-workload-identity/10584>\
**Category:** Help\
**Tags:** bigquery\
**Created:** [October 31, 2023, 10:45pm UTC](https://discourse.getdbt.com/t/can-dbt-connect-to-bigquery-using-workload-identity/10584 "2023-10-31T22:45:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilmancino](https://avatars.discourse-cdn.com/v4/letter/i/848f3c/32.png) [@ilmancino](https://discourse.getdbt.com/u/ilmancino)\
**Post date:** [October 31, 2023, 10:45pm UTC](https://discourse.getdbt.com/t/can-dbt-connect-to-bigquery-using-workload-identity/10584/1 "2023-10-31T22:45:19Z")

</div>

I use dbt BigQuery, I use the regular process of using a Service Account JSON file to establish the connection. I don’t seem to find a way to connect by using GCP [Workload Identity](https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity).  
Workload Identity uses the underlying Service Account in the cluster, without the need of passing a JSON File.

We are hosting a VM running dbt, and my company is migrating to using Workload Identity as a standard for all services connecting to GCP.

This is how I set up my connection in the profiles.yml; which works, but requires a JSON file for my Service Account Key:

```auto
    my_target:
      type: bigquery
      method: service-account
      keyfile: "{{ env_var('GOOGLE_APPLICATION_CREDENTIALS') }}"
      project: "{{ var('gcp_project') }}"
      dataset: "{{ env_var('DATASET_PREFIX') }}_"
      threads: 4
      timeout_seconds: 300
      location: US
      priority: interactive

```

---

<div class="post-metadata">

**Author:** ![fvazquez5074](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/fvazquez5074/32/3951_2.png) [@fvazquez5074](https://discourse.getdbt.com/u/fvazquez5074)\
**Post date:** [April 26, 2024, 8:28pm UTC](https://discourse.getdbt.com/t/can-dbt-connect-to-bigquery-using-workload-identity/10584/2 "2024-04-26T20:28:01Z")

</div>

Hey @ilmancino if you look at this thread, @charles-astra writes that you simply set the method to oauth and authentication will happen with the service account automatically.  
[How to run dbt on Cloud Composer and authenticate the service account - Help - dbt Community Forum (getdbt.com)](https://discourse.getdbt.com/t/how-to-run-dbt-on-cloud-composer-and-authenticate-the-service-account/4646/2)
