How to pass variable from Astro to dbt?

In the dbt_project.yml file, I use an env_var. It looks something like this:

    +grants:
        select: |
          {%- if env_var('DBT_SNOWFLAKE_ENVIRONMENT', 'DEV') in ['DEV', 'UAT'] -%} 
              {{ 'ROLEA' }}
          {%- else -%}
              {{ 'ROLEB' }}
          {%- endif -%}

And in the astro UI, I’ve created a variable called DBT_SNOWFLAKE_ENVIRONMENT and set different values based on the environment.
However, when I run the dag, it’s not picking up the value that I set on the UI. It’s always using the default value (i.e. DEV).
Why is that? How to pass that variable from UI to the dbt_project.yml file?

Hi @cfcf, how are you running dbt from Airflow? Using Cosmos, or something else?

Yes, I’m running it from airflow using cosmos.

Hi @cfcf, did you ever find a solution for this? I have the same problem, also using Cosmos.