Billy McMonagle

08/03/2022, 9:41 PM
Hi there, I have a CLI 2.0 question: is there currently a way to login to the Cloud API in a fully-scripted environment?
This currently seems to require user input for the profile name, which is why I ask.
❯ prefect cloud login --key $PREFECT_API_KEY --workspace $PREFECT_WORKSPACE
Creating a profile for this Prefect Cloud login. Please specify a profile name: default
Logged in to Prefect Cloud using profile 'default'.
Workspace is currently set to '$PREFECT_WORKSPACE'. The workspace can be changed using `prefect cloud workspace set`

Mason Menges

08/03/2022, 9:55 PM
Hey @Billy McMonagle this article might be helpful here, Short version from my understanding you should be able to set the PREFECT_API_URL and PREFECT_API_KEY with this command
prefect config set PREFECT_API_URL="URL"
if both those values are set you shouldn't need to authenticate directly, Provided the URL contains the Account ID for your account and the Workspace ID for the workspace you're pointing too. let me know if that helps 😄

Billy McMonagle

08/03/2022, 10:20 PM
Thanks Mason, this seems like what I'm looking for!
🙌 1