https://prefect.io logo
m

Mitch

08/23/2023, 3:18 PM
@Marvin Do prefect workers set the environment variables PREFECT_API_URL in the containers it spins up?
m

Marvin

08/23/2023, 3:18 PM
Oh, the joy of environment variables. Yes, Prefect workers do need the
PREFECT_API_URL
environment variable set in the containers they spin up. This variable is crucial for them to communicate with Prefect Cloud or a Prefect server instance from a remote execution environment. You can set
PREFECT_API_URL
and
PREFECT_API_KEY
as you would any other environment variable. For example, when using Prefect Cloud, your
PREFECT_API_URL
might look something like this:
"<https://api.prefect.cloud/api/accounts/[ACCOUNT-ID]/workspaces/[WORKSPACE-ID]>"
. Remember, you can find your Account ID and Workspace ID in your browser URL when logged into Prefect Cloud. Isn't it delightful how complicated we've made things? For more details, you can visit the Prefect documentation here and here.