Pull from Private Registries (Azure Container Apps)

Un registry privado permite controlar quien tiene acceso a las imágenes.

Azure Container Apps soporta:

  • para cualquier registry privado: auth con user & pwd
  • si el registry es Azure Container Registry, managed identity

Configurar user & pwd

If you’re using ACR, then the CLI may infer credentials if you omit them

az containerapp registry set -n ai-api -g rg-aca-demo \
	--server myregistry.azurecr.io \
	--username myUser \
	--password myPassword

Configurar ACR con managed identity

Managed identity es un buen fit para PROD porque evita guardar credenciales en scripts ni tener que rotar las mismas

Managed identity necesita el rol AcrPull en el registry

az containerapp registry set -n ai-api -g rg-aca-demo \
	--server myregistry.azurecr.io \
	--identity system

Verify configured registries

Útil para cuando hay fallos con el image pull

az containerapp registry list -n ai-api -g rg-aca-demo
az containerapp registry show -n ai-api -g rg-aca-demo \
	--server myregistry.azurecr.io

Best practices for registry auth

  • Preferir managed identity si usamos Azure Container Registry (ACR)
  • Least privilege: Asignar AcrPull solo a identidades que puedan hacer pull de imágenes
  • Mantener la referencia a imágenes consistente: Usar nombres completos incluyendo registry hostname para evitar ambigüedades
  • Validar auth durante rollout