Azure Compute Services
Azure provides multiple compute options for running applications. For the AZ-204 exam, focus on App Service, Azure Functions, and containerization.Azure App Service
App Service is Azure’s fully managed platform for building, deploying, and scaling web apps and APIs.Service Plans
App Service Plans define the region, compute resources, and pricing tier for your applications.Every App Service app runs in an App Service Plan which determines CPU, memory, autoscaling, and feature availability.
- Free/Shared - No SLA, shared infrastructure, limited features
- Basic - Dedicated VMs, custom domains, manual scale
- Standard - Autoscale, staging slots, daily backups
- Premium - Enhanced performance, VNet integration, more slots
- Isolated - App Service Environment (ASE), private network
Deployment Slots
Deployment slots are live app instances with their own URLs, enabling zero-downtime deployments. Key Features:- Standard tier provides 5 slots, Premium provides up to 20 slots
- Atomic swap with zero downtime
- Slot-specific settings stay with their slot (“sticky”)
- Auto-swap for continuous deployment
- Traffic percentage routing for A/B testing
Configuration Settings
App settings and connection strings are injected as environment variables at runtime. Key Concepts:- Stored encrypted, exposed as environment variables
- Connection strings prefixed by type (SQLCONNSTR_, MYSQLCONNSTR_)
- Key Vault references:
@Microsoft.KeyVault(SecretUri=...) - Slot-sticky settings don’t swap with deployment
Scaling Rules
App Service supports manual scale-out and autoscale based on metrics. Scaling Types:- Scale-up - Change pricing tier (more CPU/RAM per instance)
- Scale-out - Add more instances (horizontal scaling)
- Autoscale - Rules-based dynamic scaling (Standard tier+)
Azure Functions
Azure Functions is a serverless compute service that runs event-driven code without managing infrastructure.Triggers
Triggers define what causes a Function to execute. Each function has exactly one trigger. Common Triggers:- HTTP - Responds to REST requests
- Timer - Runs on CRON schedule
- Blob - Fires on blob create/update
- Queue - Processes Storage Queue messages
- Service Bus - Processes Service Bus messages
- Event Hub - Processes event streams
- Cosmos DB - Responds to change feed
Timer trigger uses CRON with 6 fields: seconds minutes hours day month day-of-week. HTTP trigger AuthorizationLevel options are Anonymous, Function, Admin, and User.
Bindings
Bindings declaratively connect Functions to Azure services without boilerplate code. Binding Types:- Input bindings - Read data into the function
- Output bindings - Write data from the function
- Supports: Blob, Queue, Table, Cosmos, Service Bus, SignalR, HTTP
Durable Functions
Durable Functions extends Azure Functions with stateful, long-running workflows. Function Types:- Orchestrator - Workflow coordinator (must be deterministic)
- Activity - Actual work units
- Entity - Durable actor with state
- Client - Starts/queries orchestrations
Hosting Plans
Azure Functions offers three hosting plans with different characteristics.- Consumption Plan
- Dedicated Plan
- Scale to zero when idle
- Pay per execution and GB-second
- 5-minute timeout (default), max 10 minutes
- Cold starts on first request
- Best for unpredictable, low-volume workloads
Deployment Best Practices
Run-from-Package
Use
WEBSITE_RUN_FROM_PACKAGE=1 for faster cold starts and read-only filesystemDeployment Slots
Use slots for zero-downtime deployments and testing in production-like environment
Managed Identity
Use managed identity for accessing Azure resources without credentials
Key Vault References
Store secrets in Key Vault and reference them in app settings
Exam Checklist
- Understand App Service Plan tiers and feature availability
- Know how to configure deployment slots and swap settings
- Understand slot-sticky settings and when to use them
- Know the different Function triggers and when to use each
- Understand Function bindings for input and output
- Know Durable Functions patterns and deterministic requirements
- Understand hosting plan differences and when to use each
- Know how to deploy Functions with run-from-package