Configure a local execution environment to access Prefect Cloud.
prefect cloud login
Prefect CLI command to log into Prefect Cloud from your environment.prefect cloud login
command provides an interactive login experience.
prefect cloud workspace set
Prefect CLI command while logged in, passing the account handle and workspace name:
prefect cloud workspace set
Prefect CLI
command to sync a local execution environment with a given workspace.
You may also use the prefect cloud login
command with the --workspace
or -w
option to set the current workspace.
PREFECT_API_URL
setting to specify the Prefect Cloud API.
For Prefect Cloud, configure the PREFECT_API_URL
and PREFECT_API_KEY
settings to authenticate
with Prefect Cloud by using an account ID, workspace ID, and API key.
PREFECT_API_URL
string from the page URL.For example, if you’re on the dashboard page, the URL looks like this:https://app.prefect.cloud/account/[ACCOUNT-ID]/workspace/[WORKSPACE-ID]/dashboardPREFECT_API_URL
and PREFECT_API_KEY
in the default profile.
You can use prefect profile
CLI commands to create settings profiles for different configurations.
For example, you can configure a “cloud” profile to use the Prefect Cloud API URL and API key;
and another “local” profile for local development using a local Prefect API server started with prefect server start
.
See Settings for details.
PREFECT_API_URL
and PREFECT_API_KEY
just like any other environment variable.
Setting these environment variables is a good way to connect to Prefect Cloud in a remote serverless environment.
See Overriding defaults with environment variables for more information.