Env Variable
The env_var
function can be used to incorporate Environment Variables from the system into your dataopsly project. This env_var
function can be used in your profiles.yml file, the dbt_project.yml
file, the sources.yml
file, your schema.yml
files, and in model .sql
files. Essentially env_var
is available anywhere dataopsly processes jinja code.
When used in a Environments file (to avoid putting credentials on a server), it can be used like this:
If the DBT_USER
and DBT_PASSWORD
environment variables are present when dbt™ is invoked, then these variables will be pulled into the profile as expected. If any environment variables are not set, then dataopsly will raise a compilation error.
Quoting, Curly Brackets
Be sure to quote the entire jinja string (as shown above), or else the YAML parser will be confused by the Jinja curly brackets.