Hi Prefectionists :prefect-duck: Is it possible to...
# prefect-server
j
Hi Prefectionists prefect duck Is it possible to reference an environment variable in the
config.toml
? Specific example, using an external Postgres db, and adding its connection URL in the
config.toml
under
[server.database]
. It’d be good to keep the URL a secret, but still version control the file. Or perhaps there’s a different way of configuring this, instead of adding it in the
.toml
file? Thanks in advance 🙌
k
You can configure the env var directly to override the toml. Like
Copy code
export PREFECT__SERVER__DATABASE=...
but I don’t think the toml file format can read an env var.
All of the toml configurations can be configured by env variables
j
In Prefect 1.0 we actually added custom interpolation to the toml file so you can both reference env variables and other config settings. See: https://docs.prefect.io/core/concepts/configuration.html#extensions
upvote 1
k
Wow that’s news to me. Ignore what I said.
😂 2
j
Thank you both!! 🙌 This is a pretty nice feature in 1.0 🚀