azure
CLI installed on your local machine. You can follow Microsoft’s installation guide.<resource-group-name>
with the name of your choosing, and <location>
with a valid Azure location name, such aseastus
.
echo $RG_SCOPE
in your terminal. It should be formatted as follows:
Container Instances Contributor
role has all the permissions your worker will need to run flows in other container instances. Create it by running the following command:
<identity-name>
with the name you’d like to use for the identity:
Container Instances Contributor
role we created earlier to the new identity:
AcrPull
role to the identity:
PREFECT_API_URL
and PREFECT_API_KEY
as environment variables:
<work-pool-name>
with the name of the ACI work pool you want to create in Prefect. Here we’re using the work pool name as the name of the container instance in Azure as well, but you may name it something else if you prefer.
az container create
CLI reference.
<registry-name>
with the registry name of your choosing:
IDENTITY_ID
. You can get it from your terminal by running echo $IDENTITY_ID
. When adding it to your work pool, it should be formatted as a JSON array:
IDENTITY_ID
as above, as a string<registry-name>
, followed by .azurecr.io
RG_SCOPE
environment variable created earlier in the guide. View their values by running echo $RG_SCOPE
:
flow.deploy()
, which will copy flow code into a Docker image and push that image to an ACR registry.
<registry-name>
and <work-pool-name>
with the appropriate values.
my_flow.py