Amar Eid
02/23/2022, 4:09 PMfrom prefect.tasks.secrets import PrefectSecret
@task
def my_task(secret_credentials):
return secret_credentials
with Flow('test') as flow:
credentials = PrefectSecret('NAME_OF_SECRET')
my_task(credentials)
According to this documentation https://docs.prefect.io/orchestration/concepts/secrets.html#setting-local-secrets to be able to set these local secrets I have to
1. Create a custom config file by running:
cd ~/.prefect/ && touch config.toml
2. Add the local secrets into this file
But the “.prefect” file doesnt exist on my machine. I have tried to uninstall and install prefect again and it doesnt generate. Any idea why this is happening and what I should do to create this file?
Thanks in advance for the help! //fyi @Henrietta Salonen @Maximilian LutzKevin Kho
.prefect
doesn’t exist right? As long as you didn’t explicitly specify a home directory, you can create both the .prefect
folder and the config.toml
. I believe if you authenticate to Prefect Cloud, the .prefect
folder should exist. It’s more common for config.toml
not to, but you can just create it. The one that you make gets merged to the default one.Amar Eid
02/23/2022, 4:25 PM