Thread
#prefect-community
    Jason Prado

    Jason Prado

    1 year ago
    I’m having some trouble understanding whether I should be able to run
    python myflow.py
    and read Secrets within my flow. I’ve added the Secrets in the Cloud UI and authenticated with the prefect CLI. Is the right model that “running a flow locally without an agent never hits the server” or am I mistaken?
    Jenny

    Jenny

    1 year ago
    Hi @Jason Prado - If you're running a flow locally you can set your secrets locally. Check out the local secrets section of the docs: https://docs.prefect.io/orchestration/concepts/secrets.html#setting-local-secrets
    Jason Prado

    Jason Prado

    1 year ago
    Thanks. I was able to set secrets locally using env vars and my flow succeeds. Then if I run a local agent and run a flow from the cloud UI, it succeeds. Now I’m trying to use a docker agent (
    prefect agent docker start
    ) and a
    GitLab
    storage configuration, and my flows fail:
    KeyError('The secret ... was not found...
    . I’ve set the secrets in the cloud UI under team settings. Should I be expecting the cloud secrets to be fetched in this scenario?
    Oh haha I see what I did wrong. The credential passed to the GitLab storage object should be the name of a secret, not a literal secret! Should be good now.
    Jenny

    Jenny

    1 year ago
    Glad you got it sorted!