https://prefect.io logo
Title
a

Andreas Nord

03/21/2022, 1:32 PM
Hi! What is the equivalent of using a json prefect secret in the cloud, if I want to do this in the local secret (.prefect/config.toml)?
a

Anna Geller

03/21/2022, 1:42 PM
here is one example
export PREFECT__CONTEXT__SECRETS__JSON_SECRET="{'a': 1, 'b': 2}"
👍 1
to test it:
from prefect.tasks.secrets import PrefectSecret

x = PrefectSecret("JSON_SECRET").run()
print(x)
a

Andreas Nord

03/21/2022, 1:58 PM
for the .toml file this seems to work as well which is more inline with what I wanted:
[context.secrets.json_secret]
a = 1
b = 2
👍 1