hi there, having a little trouble logging into pre...
# prefect-community
hi there, having a little trouble logging into prefect cloud with an API key in a non-interactive fashion. What i did was this
Copy code
prefect cloud login --workspace my-account/my-workspace --key ....
Creating a profile for this Prefect Cloud login. Please specify a profile name: default
Profile 'default' already exists.
I haven’t expected to be prompted about anything, it’s impossible for me to respond to the prompt. Is there another way to provide the key? An ENV var? Is there a way to “purge” the prefect config to be able to login without the prompt complaining
hi Jan, the PREFECT_API_KEY is likely what you are looking for
If you are using a docker image, I did this:
Copy code
# set prefect cloud defaults
RUN . $VENV_PATH/bin/activate
RUN /bin/sh -c "prefect config set PREFECT_API_URL=$(cat ./api_url.txt)"
RUN /bin/sh -c "prefect config set PREFECT_API_KEY=$(cat ./api_key.txt)"
ah, fantastic – thank you! i don’t want to touch the URL is it possible too keep the default?
the URL is a separate variable
Gotcha, thank you
Okay, i’ve done this now - and the API key seems set
Copy code
prefect config set PREFECT_API_KEY=***
Set 'PREFECT_API_KEY' to '***'.
Updated profile 'default'.
However, i get nothing when I ask for my workqueues
Copy code
prefect work-queue ls
           Work Queues           
┃ Name ┃ ID ┃ Concurrency Limit ┃
   (**) denotes a paused queue
Normally, i’d expect to see three work queues here. Is it confused and using some other profile other than ‘default’?
Nevermind, i had to specify the URL and then it worked