https://prefect.io logo
Title
b

Ben Welsh

03/31/2022, 8:28 PM
In my imagination, I'd like to have os.getenv calls at the very top of my flow.py that can pull in private vars in production for credentials and such.
k

Kevin Kho

03/31/2022, 8:30 PM
If it’s a credential, did you consider using Prefect Secrets instead so that you can just pull it from the Flow?
If you need to pull from
os.get_env()
, then you can pass it through the RunConfg. For example
flow.run_confg = DockerRun(...,env={"VARIABLE": "value"})
b

Ben Welsh

03/31/2022, 8:41 PM
What's the best example of Prefect Secrets you've got?
k

Kevin Kho

03/31/2022, 8:43 PM
I guess the docs here and here
and this on how to set them