[BUG] dbt Platform teams miss `DBT_CLOUD_INVOCATION_CONTEXT` env var and more in local development
- Dominant language
- Rust
- Stars
- 13.8k
- Forks
- 2.6k
- Avg merge
- 21h 31m
- Merged PRs (30d)
- 56
Description
**Describe the bug**
I'm working with two teams who have been using either the dbt Cloud CLI or dbt Studio IDE and testing out dbt Fusion. I have two similar cases:
1. One team has dbt macros that use [`DBT_CLOUD_INVOCATION_CONTEXT` environment variable](https://docs.getdbt.com/docs/build/environment-variables#special-environment-variables) to set targets and warehouses.
2. A second team usually uses dbt Studio IDE set their own custom variables: `DBT_SOURCE_DB`, `DBT_PREP_DB`, etc. that they use in `dbt_project.yml`. When they tried out dbt Fusion on VSCode, they expected that their dbt Platform env vars would be available to them, and in the interim created a `.env` file with variables -- but their preference is for these variables to be centrally managed.
In both cases, `dbtf` (in VSCode) does not recognize the environment variables from dbt Platform.
I've confirmed in dbt Studio with Fusion enabled that `DBT_CLOUD_INVOCATION_CONTEXT` is enabled. However, in local dev (VSCode) this variable does not appear to be set.
**What version of dbt Fusion is this bug in? (find out by running `dbt --version`)**
`dbt-fusion 2.0.0-preview.7`
**Is this a discrepancy between the dbt Fusion Engine and dbt Core? Check one.**
- [x] YES
- [ ] NO
**To Reproduce**
- Add a model with contents `select {{ env_var('DBT_CLOUD_INVOCATION_CONTEXT') }} as invo_context` to a local dbt Fusion project in VSCode.
- Observe the following error: `dbt1501: Failed to render SQL invalid operation: 'env_var': environment variable 'DBT_CLOUD_INVOCATION_CONTEXT' not found`
**Expected behavior**
Developers that use dbt Platform have the `DBT_CLOUD_INVOCATION_CONTEXT` environment variable available in their VSCode local development environment.
**Operating System and CPU Type (please complete the following information):**
Apple Silicon
Contributor guide
Assessment
This issue has not been assessed yet.