ImageSpec with ACR#

In this section we explain how to use Azure Container Registry (ACR) to build and deploy task container images using ImageSpec.

Before proceeding, make sure that you have enabled Azure Container Registry for you Union installation.

Authenticate to the registry#

Authenticate with the container registry

az login
az acr login --name <acrName>

Refer to Individual login with Microsoft Entra ID in the Azure documentation for additional details.

Register your workflow to Union#

You can now register tasks with ImageSpec declarations that reference this repository.

For example, to use an existing ACR repository, we would alter the Python code in the previous section, to have the following ImageSpec declaration:

image_spec = ImageSpec(
    registry="<AZURE_CONTAINER_REGISTRY_NAME>.azurecr.io",
    name="my-repository/simple-example-image",
    base_image="ghcr.io/flyteorg/flytekit:py3.11-latest",
    requirements="image-requirements.txt"
)