https://prefect.io logo
f

Florian Guily

03/24/2022, 10:48 AM
Hey, is there a way to instantly force the execution of a PrefectSecret task and set it with no upstream ?
k

Kevin Kho

03/24/2022, 1:43 PM
Yes
Copy code
with Flow(...)
    PrefectSecret("Something")()
a

Anna Geller

03/24/2022, 1:44 PM
Yes, there is! You can invoke it from your local Python script using e.g.:
Copy code
from prefect.tasks.secrets import PrefectSecret

print(PrefectSecret("A_PASSWORD_DEV").run())
You may need to set this env variable beforehand:
Copy code
export PREFECT__CLOUD__USE_LOCAL_SECRETS=false
4 Views