Hi, is there a way to use .env in dbt profiles.yml...
# integration-dbt
e
Hi, is there a way to use .env in dbt profiles.yml for BigQuery service-account.json? Or is there better way to do this? Thanks
r
This is a dbt, rather than Dagster specific question. I suggest that you take a look at https://docs.getdbt.com/docs/core/connect-data-platform/bigquery-setup. Dagster supports
.env
(link), but this is for environment variables accessed in Dagster code.
profiles.yml
is a dbt specific concept, and I don’t think
dbt-core
supports
.env
files.
a
This is how we do it and works.
Copy code
client:
  target: dev
  outputs:
    dev:
      dataset: DATASET
      job_execution_timeout_seconds: 300
      job_retries: 1
      location: EU
      method: service-account
      keyfile: "{{ env_var('IO_MANAGER_CREDENTIALS') }}"
      priority: interactive
      project: ....
      threads: 1
      type: bigquery
👍🏽 1
e
Thanks for replying. Is this how you do it?https://docs.dagster.io/integrations/bigquery/reference#providing-credentials-as-configuration
Copy code
cat ~/.gcp/key.json | base64
a
Not really. In our case, we just have in the .env file something like this:
Copy code
IO_MANAGER_CREDENTIALS = "/..../creds.json"
🌈 1