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
- The Entry Point: The public client securely connects via HTTPS to the Azure App Service Instance boundary.
- Main Routing: Traffic hits the Main API Container because it is marked as
isMain: true. - 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.
- 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:
- Model Server Sidecar: A FastAPI app running ONNX Runtime GenAI that serves the Phi-3 Mini model.
- Main Application: A Flask web application that acts as the user interface and proxies inference requests to the sidecar over
localhost.
Topics Covered
03 - Observability & Troubleshooting
Master container logging, real-time log streaming, Kudu (SCM) diagnostic console, interactive SSH access, Log Analytics (KQL), and production troubleshooting gotchas.
01 - Choose the App Service Sidecar Pattern
Evaluate architectural trade-offs, network isolation, container lifecycle coupling, and configuration models for sidecar-enabled AI workloads.
