Study guide

10.3 Configure & Deploy Function Apps

Exam AI-200: Developing AI Cloud Solutions on Azure Exam

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

1.1 Current Exam Facts 1.2 Audience Profile & Study Path

2 Chapter 1: Container Registry & App Service Hosting

1.1 ACR: Build, Store, Version & Manage Images 1.2 ACR Tasks: Build & Run Images 1.3 Deploy Containers to Azure App Service

3 Chapter 2: Azure Container Apps & KEDA Scaling

2.1 Azure Container Apps: Environments, Config & Revisions 2.2 KEDA Event-Driven Scaling in Container Apps

4 Chapter 3: AKS Manifests & Container Troubleshooting

3.1 Deploy & Manage Apps on AKS with Manifests 3.2 Monitor & Troubleshoot AKS and Container Apps

5 Chapter 4: Cosmos DB for NoSQL Fundamentals

4.1 Cosmos DB for NoSQL: SDK Connect & Queries 4.2 Optimize RUs: Indexing Policies & Consistency Levels

6 Chapter 5: Cosmos DB Vectors & Change Feed

5.1 Embeddings & Vector Similarity Search in Cosmos DB 5.2 Change Feed Processor for New/Updated Items

7 Chapter 6: Azure PostgreSQL Foundations for AI

6.1 Azure Database for PostgreSQL: Connect & Query with SDKs 6.2 Schema Design, Data Types & Indexing Strategies 6.3 pgvector Indexing: Latency & Compute Overhead

8 Chapter 7: PostgreSQL Vector Workloads & RAG

7.1 Configure Compute, Memory & Storage for Vector Workloads 7.2 Vector Search, Semantic Retrieval & RAG with Metadata Filters 7.3 Connection Optimization for Throughput & Latency

9 Chapter 8: Azure Managed Redis for AI Solutions

8.1 Azure Managed Redis: Caching, Expiration & Invalidation 8.2 Redis Vector Indexing for Similarity Search

10 Chapter 9: Service Bus & Event Grid for AI Pipelines

9.1 Service Bus Queues & Message Processing 9.2 Topics, Subscriptions & Dead-Letter Queues 9.3 Event Grid: Custom Events & Filters 9.4 Event Grid Retries & Event-Driven Workflows

11 Chapter 10: Azure Functions for Serverless AI Back Ends

10.1 Azure Functions: Triggers & Bindings 10.2 Build Serverless APIs with Functions 10.3 Configure & Deploy Function Apps

12 Chapter 11: Key Vault & App Configuration

11.1 Azure Key Vault: Secret Storage & Retrieval 11.2 Key Vault Secret Rotation Patterns 11.3 Azure App Configuration for App Settings

13 Chapter 12: OpenTelemetry & KQL Observability

12.1 Distributed Tracing with OpenTelemetry SDKs 12.2 Correlating Traces into Azure Monitoring 12.3 Write KQL Queries to Analyze Logs 12.4 KQL for Metrics & Troubleshooting Scenarios

10.3 Configure & Deploy Function Apps

Key Takeaways Explain This Topic AI

App settings store connection strings, AI endpoint URLs, and feature flags; prefer Key Vault references and managed identities over secrets in code

Hosting plans (Consumption vs Premium vs Dedicated) trade cost for cold-start behavior and VNet features — Premium is often chosen for latency-sensitive AI APIs

Deploy with zip deploy, VS Code/Core Tools, GitHub Actions/Azure DevOps CI, or deployment slots for safer releases

Slots enable staged swap of Function App versions without downtime when supported on the plan

  • Configure CORS, scaling, runtime version, and Application Insights as part of production Function App setup
  • Last updated: July 2026

Building triggers and HTTP APIs is only half of the AI-200 skill. You must also configure and deploy Function Apps so they run securely, scale under AI traffic, and ship updates without breaking production chat or document pipelines.

Function App configuration essentials

A Function App is an App Service specialization. Configuration lives primarily in Application settings (environment variables at runtime). Your code reads settings such as AZURE_OPENAI_ENDPOINT , storage connection names referenced by bindings, and feature flags.

  • Setting area Examples Exam tip
  • Runtime FUNCTIONS_WORKER_RUNTIME ( dotnet-isolated , python , node , …) Must match your language stack
  • Storage AzureWebJobsStorage Required by the host for locks, triggers, and internal state

Extensions Binding connection names ( MyBlobStorage , Service Bus conn) Bindings resolve connections from app settings

  • AI services Endpoint URLs, deployment names Prefer managed identity; avoid raw keys in settings when possible
  • Secrets Key Vault references ( @Microsoft.KeyVault(...) ) Secrets stay in Key Vault; settings hold references
  • Hosting Plan, region, OS (Linux/Windows) Affects cold start, cost, and scaling
  • Managed identity and Key Vault

Enable a system-assigned or user-assigned managed identity on the Function App. Grant that identity roles such as Cognitive Services OpenAI User, Storage Blob Data Reader, or Key Vault Secrets User. Then:

Call Azure OpenAI with token credentials instead of API keys when supported.

Store remaining secrets in Key Vault and reference them from app settings.

Exam distractors often show connection strings pasted into source files — always choose configuration + identity over hard-coding.

Hosting plans and AI latency

  • Plan Billing model Cold starts Notable features
  • Consumption Per execution + resource consumption Possible after idle Scale to zero; lowest idle cost

Premium (Elastic Premium) Pre-warmed instances + execution Reduced / avoidable with pre-warmed VNet integration, longer run duration, better for chat APIs

  • Dedicated (App Service plan) Always-on VM-like plan Predictable if Always On Familiar App Service isolation
  • Why Premium matters for AI backends

Interactive AI APIs are sensitive to tail latency . On Consumption, an idle Function App may cold-start: the platform allocates a worker, loads the language worker, and then runs your code — adding seconds before the first token streams back. Premium plans keep pre-warmed instances so HTTP-triggered chat backends feel snappier. Premium also supports regional VNet integration , useful when the function must reach private Azure OpenAI, AI Search, or storage endpoints.

Choose Consumption for bursty, cost-sensitive batch workers (queue-triggered embedding jobs) where an occasional cold start is acceptable. Choose Premium (or Dedicated with Always On) when AI-200 scenarios emphasize low-latency user-facing APIs or private networking.

Deployment options

Method How it works Typical use

Zip deploy Upload a zip of the app package to the Kudu/ scm endpoint or via Azure CLI Simple CI steps, Core Tools publish

  • Azure Functions Core Tools / VS Code func azure functionapp publish Local developer publish
  • CI/CD (GitHub Actions, Azure DevOps) Build → test → deploy pipeline Team production releases
  • Run-From-Package App runs directly from a mounted zip package Atomic, immutable deployments
  • Deployment slots Stage in a slot, then swap to production Blue-green style releases
  • Container Deploy Functions in a custom container Custom dependencies, advanced isolation
  • Zip deploy and Run-From-Package

Zip deploy packages your compiled functions and dependencies. With Run-From-Package , the platform mounts the zip as a read-only filesystem, which reduces file-lock issues and makes deployments atomic — a common best practice for Node and .NET publish outputs. Azure CLI and GitHub Actions templates often set WEBSITE_RUN_FROM_PACKAGE accordingly.

Deployment slots

On plans that support slots (Premium and Dedicated; not classic Consumption the same way), you deploy to a staging slot , validate HTTP health and a smoke inference call, then swap into production. Swap keeps sticky settings you mark as slot-specific (for example, a staging Azure OpenAI deployment name) while moving the code. This reduces downtime and makes rollback a reverse swap.

CI/CD checklist for AI Function Apps

Build and run unit tests (including binding/trigger metadata validation where applicable).

Deploy to a slot or test Function App.

Apply infrastructure settings (app settings, identity role assignments) via Bicep/Terraform — not manual portal-only drift.

Smoke-test: anonymous health endpoint OK; authenticated completion endpoint returns 200.

Swap or promote; watch Application Insights for error rate spikes.

Never commit local.settings.json secrets to git; that file is for local Core Tools only. Production uses app settings / Key Vault.

Networking, CORS, and scaling knobs

CORS: Allow specific SPA origins on the Function App or terminate CORS at API Management.

Scale out: Consumption and Premium scale out based on trigger load (HTTP concurrency, queue length). Understand that each instance may open connections to Azure OpenAI — watch service throttling ( 429 ) and use retries with backoff.

Runtime version: Pin a supported Functions runtime major version; upgrades can change extension bundles.

Extension bundles: Non-.NET languages often rely on extension bundles for binding support — keep them current in host.json guidance from Microsoft docs.

host.json vs app settings

  • File / store Controls
  • host.json Host behavior: logging, extension options, queue batch sizes, HTTP route prefix, sampling
  • App settings Environment-specific values: connections, endpoints, keys/references, runtime
  • local.settings.json Local emulation only — not deployed as production config

For AI workers, host.json might tune queue batch size so document jobs process efficiently without overwhelming the model endpoint. App settings still hold the endpoint URL and deployment name.

Monitoring after deploy

Connect Application Insights during Function App creation or afterward. Use live metrics during a slot swap. Set alerts on failed function executions and dependency failures to Azure OpenAI. Log Analytics queries help prove whether latency is cold start, model time, or downstream storage.

End-to-end production picture

Create Function App on Premium if the AI API is user-facing and latency-sensitive; use Consumption for async queue workers if cost dominates.

Enable managed identity ; grant access to Storage, Key Vault, and Azure AI resources.

Configure app settings and Key Vault references; set FUNCTIONS_WORKER_RUNTIME .

Deploy via CI zip deploy / Run-From-Package into a slot , smoke-test, swap .

Monitor with Application Insights ; tune scale and plan if cold starts or throttling appear.

Key Takeaways

App settings + Key Vault references + managed identity are the secure configuration pattern.

Consumption scales to zero but can cold-start; Premium reduces latency for AI HTTP APIs and adds VNet options.

Zip deploy, Run-From-Package, CI/CD, and deployment slots are the main deployment tools.

Keep secrets out of source; use slots for safer releases; monitor with Application Insights.