how would I authenticate with prefect cloud non-interactively? I added PREFECT_CLOUD_KEY=pnu_... and PREFECT_API_URL=https://api.prefect.cloud/api/accounts/... environment variables. For example if I wanted to run this file without running prefect cloud login
Copy code
import time
from prefect import flow, serve
@flow
def slow_flow(sleep: int = 60):
"Sleepy flow - sleeps the provided amount of time (in seconds)."
time.sleep(sleep)
@flow
def fast_flow():
"Fastest flow this side of the Mississippi."
return
if __name__ == "__main__":
slow_deploy = slow_flow.to_deployment(name="sleeper", interval=45)
fast_deploy = fast_flow.to_deployment(name="fast")
serve(slow_deploy, fast_deploy)
k
Kevin Grismore
05/21/2024, 5:20 PM
the first env var name should be
PREFECT_API_KEY
Kevin Grismore
05/21/2024, 5:20 PM
as long as those two are present, prefect should be authed to your cloud account
p
Patrick Wspanialy
05/21/2024, 5:23 PM
whoops, I changed the name at some point I guess. thanks @Kevin Grismore
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.