Thread
#prefect-community
    Jacob Bedard

    Jacob Bedard

    11 months ago
    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.
    Kevin Kho

    Kevin Kho

    11 months ago
    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?
    Jacob Bedard

    Jacob Bedard

    11 months ago
    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
    Kevin Kho

    Kevin Kho

    11 months ago
    Oh oof your question is how to toggle the
    use_local_secrets
    ?
    You can set an env variable
    "PREFECT__CLOUD__USE_LOCAL_SECRETS": "false"
    Jacob Bedard

    Jacob Bedard

    11 months ago
    I need to use the CLI for that?
    Kevin Kho

    Kevin Kho

    11 months ago
    @Marvin archive “Add USE_LOCAL_SECRETS example to docs”
    You can set it with
    export PREFECT__CLOUD__USE_LOCAL_SECRETS=false
    Jacob Bedard

    Jacob Bedard

    11 months ago
    Ah nice
    Thank you very much! I'll try that out momentarily
    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?
    Kevin Kho

    Kevin Kho

    11 months ago
    Yep! That’s weird. The environment variable should work. Will make an issue for more configs to be listed.