How azure-samples/openai works
Project type and purpose
• This is a multi-module sample repository for Azure OpenAI Service, providing:
• Basic code snippets (Python, .NET, REST) demonstrating prompts, completions, embeddings, chat, DALL-E, Whisper, etc.
• End-to-end solutions (eCommerce demo, virtual assistant, call-center intelligence) combining UI, backend services, data stores, search, and AI models.
• Solution accelerators (Advanced RAG, Retail) showing full microservice architectures on Azure (AKS, App Service, Key Vault, Cosmos DB, AI Search).
• It’s not a single application but a collection of varied reference architectures.
High-level architecture patterns
• Each “solution” follows a full-stack, microservices-style pattern:
• Frontend: static SPA (React/Vite or ASP.NET Razor pages)
• Backend APIs: Python Flask/FastAPI or .NET Web API services for chat, ingestion, orchestrator, session manager
• Data layer: Azure Cosmos DB, Azure SQL, Azure Storage, vector stores (Qdrant, Milvus, Azure AI Search)
• AI layer: calls to Azure OpenAI Service (chat completions, embeddings, DALL-E, Whisper) and Azure Cognitive Services
• Infrastructure as code: Bicep ARM templates, Dockerfiles, Kubernetes manifests
• Common cross-cutting services: Key Vault (secrets), App Insights (logging), Managed Identity/Role-based security.
• User/client (web browser or notebook)
• Frontend UI (SPA or Razor web app)
• API Gateway / App Service front door (optional)
• Backend microservices grouped by function:
• Ingestion Service (data ingestion, document prep)
• Search Service (vector search, Azure AI Search)
• Orchestrator Service (prompt composition, multi-step workflows)
• Session Manager (chat session persistence, adaptive cards)
• Data stores:
• Cosmos DB or SQL DB for metadata, session logs
• Blob Storage for documents, embeddings files
• AI endpoints:
• Azure OpenAI Service (model endpoint)
• Azure Cognitive Services (speech-to-text, vision, filters)
• DevOps / Infra: Bicep modules for compute (AKS/App Service), database, search, key vault
Architectural patterns & principles
• Microservices—each domain (ingestion, search, orchestrator, session) is isolated
• Event-driven or request-response via REST APIs
• IaC—define infra components with Bicep and Kubernetes manifests
• Secure by design—Key Vault for secrets, managed identities, role assignments
• Scalability—AKS or App Service Plan for auto-scale
Final touches
• Security boundaries (public internet vs. private VNet)