dbt · dbt Fundamentals

What is profiles.yml?

Easyprofiles.ymlcredentialstargetsenvironments

Interview question

What is a dbt profile / profiles.yml, and how does it relate to dbt_project.yml?

How to answer

The short answer

A profile tells dbt how to connect to a warehouse: type, account, database, schema, credentials, threads. Profiles usually live in ~/.dbt/profiles.yml (or another path set by DBT_PROFILES_DIR).

Example sketch

YAML
my_analytics:
  target: dev
  outputs:
    dev:
      type: snowflake
      account: xy12345
      user: "{{ env_var('DBT_USER') }}"
      password: "{{ env_var('DBT_PASSWORD') }}"
      role: TRANSFORMER
      database: ANALYTICS
      warehouse: TRANSFORMING
      schema: dbt_dev_alice
      threads: 4
    prod:
      type: snowflake
      # ... prod connection ...
      schema: analytics
      threads: 8

dbt_project.yml has profile: my_analytics. When you run dbt run --target prod, dbt loads the prod output from that profile.

Targets

A target is one named connection (often dev, ci, prod). Same project code, different schemas/databases.

Interview tip: "Project config is shared in git; profiles are per-developer or per-CI secret. Prefer env_var for passwords so secrets never sit in plaintext YAML."