/az-func-aci

Simple container orchestration using Azure Durable Functions & ACI

Primary LanguageC#

Serverless batch processing using Azure Durable Functions and Container Instances

This samples shows how you can orchestrate the life cycle of Azure Container Instances using Azure Durbale funcionts a in true serverless fashion. Azure Durable Functions are used to do the orchestration of the container deployment, monitoring and cleanup of Azure Container Instances. Azure Container registry stores the container images. Used Azure Active Directory and Managed Service Identity within Functions to manage the Container Instances.

Architecture

  1. A HTTP Trigger will invoke the Azure Durable Function to orchestrate the container deployment.
  2. First activity function will create the ACI group and with the container image stored in the Azure Container Registry. Used Azure Fluent API and ACI Management libraries for accomplishing this task.
  3. A URL for the API from the container will be received from the above activity function and that is used to call and start the job. The same API can be used for monitoring the job progress.
  4. Once the job completed successfully, the program within the container will invoke the Azure Durable Function by raising an external event and provides the status of the Job stating whether its completed or failed.
  5. Container Group will be deleted or stopped depending on the status from the step #4. Please refer the options here. You can also control the container instance using restart policies