Nathaniel Russell
09/13/2022, 7:48 PMprefect.client.get_client()
supposed to know which account of prefect cloud to use? how does it get the api key?Mason Menges
09/13/2022, 7:52 PMNathaniel Russell
09/13/2022, 8:00 PMMason Menges
09/13/2022, 8:30 PMprefect.client.get_client()
is specifically looking for these 2 environment variables
• PREFECT_API_URL
• PREFECT_API_KEY
As long as those are set whether you set them in you're python code or through the cli it'll return a client connected to Prefect Cloud based on those values, if they aren't set then it returns a client tied to an Ephemeral API.
So something like this should work
os.environ["PREFECT_API_URL"] = "<https://api.prefect.cloud/api/accounts/account_id/workspaces/workspace_id>"
os.envrion["PREFECT_API_KEY"] = "api_key"
prefect.client.get_client()
the profile serves as a base configuration in your environment but you can still set the variables manually which overwrites anything in the profile.Nathaniel Russell
09/13/2022, 8:46 PM