https://prefect.io logo
#prefect-community
Title
# prefect-community
w

wonsun

06/15/2022, 7:03 AM
Hi all! Shouldn't the
config.toml
file be in the path where prefect is installed? There is only
backend.toml
file in the path where my prefect is installed, are those two the same? Also i can't read
backend.toml
. I got the error message like below:
Copy code
TomlDecodeError: Found invalid character in key name: ':'. Try quoting the key name. (line 1 column 2 char 1)
What's the backend.toml file?
1
a

Anna Geller

06/15/2022, 11:26 AM
backend.toml is only a config whether you use Cloud or Server
Shouldn't the
config.toml
file be in the path where prefect is installed?
it's not required - most of the configurations can be set via environment variables, but they can also alternatively be configured on config.toml if that's your preference I hope I haven't confused you even further
e.g. ~/.prefect/config.toml with:
Copy code
[server]
host = ...
port = ...
is equivalent to shell commands:
Copy code
export PREFECT__SERVER__HOST=xxx
export PREFECT__SERVER__PORT=xxx
w

wonsun

06/16/2022, 3:44 AM
Uhm.. The reason I want to find the config.toml file is to work with Adding context globally. (link)
And i can't find config.toml.. under the .prefect
a

Anna Geller

06/16/2022, 11:31 AM
so you shouldn't modify context but you can use it in your flows context is totally unrelated to config.toml actually could you explain what you are trying to do on a business level? what do you want to modify globally?
w

wonsun

06/21/2022, 7:00 AM
oh, anna sorry to late answer. (I don't know exactly what 'context' work for) Actually i want to use the 'context' to always have the information of database connection rather than use resource manager. The reason why don't use resource manager is resource manager can't detect the invaild connection of database. So i want to put the information of database connection to context and then the context always callable that information. If this method too poor, please tell me without reserve🤗
a

Anna Geller

06/21/2022, 11:24 AM
to store credentials, in Prefect 1.0 there is a concept of Secrets - you can store your DB credentials there
w

wonsun

06/22/2022, 12:38 AM
Thanks Anna, i'll see the Secrets!
13 Views