I haven't found a code example that actually reach...
# ask-community
j
I haven't found a code example that actually reaches into a cloud team and collects a secret. It looks like "use_local_secrets" needs to be passed to an argument, but I'm not sure where. For now, I just want to set this stuff for my current python session.
k
Hey @Jacob Bedard, if you set “use_local_secrets” to False, it will pull it from Cloud. If you want to test with a Local Secret, have you seen this part of the docs on how to set this?
j
Yeah, I've seen that doc, but I don't clearly see which actual function this gets passed to. In that vein, I think it would be really helpful to see more code examples in general for prefect cloud
k
Oh oof your question is how to toggle the
use_local_secrets
?
You can set an env variable
"PREFECT__CLOUD__USE_LOCAL_SECRETS": "false"
j
I need to use the CLI for that?
k
@Marvin archive “Add USE_LOCAL_SECRETS example to docs”
You can set it with
export PREFECT__CLOUD__USE_LOCAL_SECRETS=false
j
Ah nice
Thank you very much! I'll try that out momentarily
👍 1
It was just a bit off from what I needed to do, it turns out
prefect.context.config.cloud.use_local_secrets = False
was the line I had to execute in python. I found that in the get method in the definition of the function
Had to check the github - would be cool if you folks added this insight in how to access these variables right in the docs page, rather than having to go to github - it'd be less work and smoother for your user base that way
Anyway, I was able to authenticate and pull my secret! Now I can figure out how to make my first task and flow, then once I get that working, I'll have to figure out how agents work. Sound like the right approach?
k
Yep! That’s weird. The environment variable should work. Will make an issue for more configs to be listed.