i'm trying to use a prefect secret in the most bas...
# prefect-community
i'm trying to use a prefect secret in the most basic way and am having some difficulty...my call
fails when I try to register my flow:
Copy code
ValueError: Local Secret "SECRET_KEY" was not found.
my backend is set to
, and I do not have
use_local_secrets = true
set in my config.toml, so I'm not sure why prefect is trying to actually retrieve a local secret there
given how lightweight the documentation on using secrets is, this seems like it should be very straightforward...does one need to explicitly set
use_local_secrets = false
in the config.toml?
It sounds like it: "For Cloud users, if the secret is not found in local context and
, the base
class queries the Prefect Cloud API for a stored secret." So you satisfy the first condition, but without explicitly setting it to false, the second condition is not satisfied.
@Amanda Wee can you link me to where you're reading that? I don't see it on https://docs.prefect.io/orchestration/concepts/secrets.html#using-a-secret – maybe this page of the documentation needs a makeover
ah i see, it's in the core documentation but not the orchestration documentation, thanks for the heads up!
@Sean Talia We’re using prefect cloud too, this is how we’ve been setting secrets:
Copy code
    prefect.context.secrets["EMAIL_USERNAME"] = (SOME_EMAIL)
The first line checks if the
dictionary already exists, and if it doesn’t, creates it for you. The second one shows you how to add values to it. I hope this helps!