0

I'm trying to follow the Prefect Quickstart guide. I'm using a GitHub codespace. I was able to clone and run 01_getting_started.py without trouble. however when I run step 3

uvx prefect-cloud deploy 01_getting_started.py:main \ 
--name my_first_deployment \ 
--from https://github.com/PrefectHQ/quickstart

when I follow that it opens a webpage that says

 "To continue, please run the following in your terminal:" 

but in the terminal it doesn't have an option to enter the key. So the codespace hangs indefinitely.

I've also tried going line by line, using the login and the key. which says

prefect cloud login --key <<my_key>>
It looks like you're already authenticated on this profile.
? Would you like to reauthenticate? [y/N]: N
Authenticated with Prefect Cloud! Using workspace 'username/default'.

If I choose no, it says everything is fine. which it is, until I run

prefect-cloud deploy 01_getting_started.py:main 

where it then inevitably asks to open the authorization window and the cycle repeats.

I think the simple workaround of course would be finding out why it's not opening a space to open this in the codespace, but I can't square it. In my cloud console it shows that the first flow has succeeded

"Task Runs
51
51
Completed
100%"

Other fun bits and bobs: If I tell it I do want to re-authenticate, the following happens:

@user ➜ /workspaces/Prefect (main) $ prefect cloud login
It looks like you're already authenticated on this profile.
? Would you like to reauthenticate? [y/N]: y
? How would you like to authenticate? [Use arrows to move; enter to select]
 Log in with a web browser 
> Paste an API key 
Paste your API key: 
Authenticated with Prefect Cloud! Using workspace 'user/default'.
@user ➜ /workspaces/Prefect (main) $ ls
LICENSE README.md prefect_01_getting_started.py quickstart
@user ➜ /workspaces/Prefect (main) $ prefect-cloud deploy 01_getting_started.py:main \
> --name my_first_deployment \
> --from https://github.com/PrefectHQ/quickstart

same hanging. Feeling like I'm losing my mind in this loop. Please help.

asked Apr 30, 2025 at 22:18

1 Answer 1

1

I'm sorry you're running into this.

Could you try running prefect-cloud login --key <key>(note the - in prefect-cloud) and see if that works instead? Additionally would you mind sharing your browser version?

In case that doesn't work here are some other workarounds:
1: Try Chrome (if you're not already)
2: Manually create/edit ~/.prefect/profiles.toml to look like:

active = "prefect-cloud"
[profiles.prefect-cloud]
PREFECT_API_URL = "https://api.prefect.cloud/api/accounts/<your account id>/workspaces/<your workspace id>"
PREFECT_API_KEY = "<your api key>"

3: Use environment variables:

export PREFECT_API_URL="https://api.prefect.cloud/api/accounts/<your account id>/workspaces/<your workspace id>"
export PREFECT_API_KEY="<your api key>"
answered May 1, 2025 at 3:59
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.