Ryan Sattler

09/21/2022, 1:03 AM
Hi - we have an API that’s trying to register and run flows programatically via Prefect 1 Cloud, using the Prefect Python lib. We need to do this against two different Tenants in Prefect Cloud. This leads to an issue with credentials - since Prefect’s credentials seemingly need to be stored globally either in an env var or in a file, trying to switch between tenant auths while concurrently publishing multiple flows (eg one to tenant 1, one to tenant 2) is leading to a race condition. We might be able to work around this via multiprocessing but is there a cleaner way to do it, eg some way to set auth per call rather than globally?

Mason Menges

09/21/2022, 3:15 PM
Hey @Ryan Sattler You should be able to do this by setting the api key and tenant id on the prefect client making the api calls

Ryan Sattler

09/26/2022, 12:40 AM
ah thanks @Mason Menges I missed that