is there a way to use secrets when registering a f...
# ask-community
z
is there a way to use secrets when registering a flow? E.g, I want to register flows via a CI pipeline, however I keep getting “local secret not found”. I would have thought that logging in w/ the cli and setting my backend to cloud wouldve forced prefect to look at cloud secrets, but maybe I am missing something? Setting environment variables does work, but I’d like to try to avoid specifying secrets via the UI and in circleci if possible.
k
Hi @Zach Schumacher, is this what you’re looking for ?
Oh I see what you mean
Will ask the team about this.
z
yeah i guess what i want is a lazy secret that only evaluates on cloud? Maybe the answer is just it has to be encapsulated in a task Would be cool if i could use secrets when setting env vars on a k8s run config object, tho.
Copy code
# something like this
flow.run_config = KubernetesRun(env={"MY_SECRET": CloudSecret("MY_SECRET")})
k
You can use
PREFECT__CLOUD__USE_LOCAL_SECRETS=false
And it will pull it from Cloud
z
oh thats perfect, thanks!
👍 1