Azure AI Hub LogoAzure AI Hub
04 - App Service Sidecars for AI

04 - App Service Sidecars for AI

Master deploying multi-container Linux applications with AI inference sidecars on Azure App Service.

Overview

In this lab, you will learn how to design, configure, and deploy sidecar-enabled AI applications on Azure App Service.

An Azure App Service sidecar is an auxiliary container running in the exact same Linux virtual machine instance alongside your main application container. This architectural pattern allows you to run local AI model inference engines (such as Ollama, Text Embeddings Inference, or Small Language Models), telemetry collectors, or caching layers without bloating your main application image.


Architectural Pattern: Main vs. Sidecar Containers

Flow Explanation

  1. The Entry Point: The public client securely connects via HTTPS to the Azure App Service Instance boundary.
  2. Main Routing: Traffic hits the Main API Container because it is marked as isMain: true.
  3. Internal Handoff: The Main API Container executes business logic and forwards inference requests privately to the Model Server Sidecar over the shared localhost network namespace.
  4. Shared State: Both containers write and read from the exact same Shared Disk Volume to maintain synchronized state, without needing an external database.

Lab Modules

In this lab module, you will build and deploy a real-world pattern:

  1. Model Server Sidecar: A FastAPI app running ONNX Runtime GenAI that serves the Phi-3 Mini model.
  2. Main Application: A Flask web application that acts as the user interface and proxies inference requests to the sidecar over localhost.

Topics Covered

On this page