Anthony Finocchiaro
04/19/2023, 6:28 PMRUN az login --service-principal -u ${SP_ACCESS_KEY_ID} -p ${SP_SECRET_ACCESS_KEY} --tenant ${SP_TENANT_ID} \
&& /bin/sh -c "prefect config set PREFECT_API_URL=$(az keyvault secret show --name PREFECT-API-URL --vault-name secretsmanager --query value)" \
&& /bin/sh -c "prefect config set PREFECT_API_KEY=$(az keyvault secret show --name PREFECT-API-KEY --vault-name secretsmanager --query value)" \
&& /bin/sh -c "prefect block register -m prefect_azure" \
&& /bin/sh -c "prefect block register -m prefect_azure.container_instance"
Ryan Peden
04/20/2023, 6:17 AMValueError
message you're getting when trying to load any block might mean your flow is running in ephemeral mode and not connecting to the API.
After you build the container, if you run it in interactive mode with a command like
docker run -it my-org/my-image:latest bash
then then once you're in, run
prefect config view
do you see the PREFECT_API_URL you're expecting?
If not, there might be an issue in your Dockerfile. The first place I'd check is the az login
step. If you're not already passing the SP_
variables into your Dockerfile as build args, you might need to.Anthony Finocchiaro
04/27/2023, 5:09 AM