Sean Talia

02/09/2021, 2:58 PM
i'm trying to use a prefect secret in the most basic way and am having some 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?

Amanda Wee

02/09/2021, 3:12 PM
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.

Sean Talia

02/09/2021, 3:13 PM
@Amanda Wee can you link me to where you're reading that? I don't see it on – 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!

Fina Silva-Santisteban

02/10/2021, 12:40 AM
@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!