Skip to content

AZ-204 cheat sheet ​

The distinctions that decide AZ-204 questions, grouped by service. For the underlying concepts, work through the official learning path listed under resources.

Caching ​

Shared vs Private Caching ​

AspectShared CachePrivate Cache
LocationCentralized server/clusterLocal to each app instance
SpeedSLOWER (network hop)FASTER (local access)
ScalabilityBETTER (add cluster nodes)Worse (scale each instance)
ConsistencyAll instances see same dataData may differ between instances

Key Point: Shared caching is NOT faster than private caching - it provides better SCALABILITY.

Cache Eviction Policies ​

PolicyWhat It DoesUse When
FIFORemoves OLDEST items firstOldest data = stale data
LRURemoves LEAST RECENTLY USEDRecent access = likely needed
MRURemoves MOST RECENTLY USEDRecently used = won't need again
ExplicitTriggered by DB notificationReal-time data sync needed

Exam Tip: LRU = "Least Recently Used" - removes items that haven't been accessed recently

Azure Cache for Redis - Eviction ​

  • Eviction policy for oldest data first → Use FIFO (First-In-First-Out)
  • LRU is about access patterns, FIFO is about age

App Service web apps ​

Application Logging: Filesystem vs Blob Storage ​

Storage TypeDurationRegion Requirement
FilesystemSHORT-TERM (12 hours auto-off)N/A
Blob StorageLONG-TERM (persistent)SAME REGION as App Service

Exam Trap: Blob storage for logging must be in the SAME REGION as the App Service!

Diagnostics Settings ​

  • AppServiceConsoleLogs → Logs to Log Analytics (not storage account for query analysis)
  • To query logs, send to Log Analytics workspace, not storage account

TLS Mutual Authentication (Client Certificates) ​

  • Access client cert via: HttpRequest.ClientCertificate property
  • NOT through HTTP headers, URL query string, or client cookies
  • Only supported for ASP.NET applications

Deployment Slots - Swapping Behavior ​

Settings that SWAP (follow the slot):

  • Connection strings (unless marked sticky)
  • Handler mappings, public certificates

Settings that DON'T SWAP (stay with slot):

  • Publishing endpoints
  • Custom domain names
  • SSL certificates (private)
  • Scale settings

Message-based solutions ​

Service Bus vs Queue Storage ​

FeatureService BusQueue Storage
Max message size256KB-100MB64KB
Max queue size1GB-80GB500TB
ProtocolHTTPS/AMQP/TCPHTTPS only
Progress trackingYES (sessions)No
Point-to-pointTopics & QueuesQueues only

Use Azure Queue Storage when: Volume > 80GB, need simple queue, HTTPS only is OK

Use Service Bus when: Need AMQP/TCP, sessions, topics, or message progress tracking

Service Bus - ServiceBusMessage ​

csharp
// Send message - use BinaryData, NOT string
ServiceBusMessage message = new ServiceBusMessage(BinaryData.FromString(messageBody));
await sender.SendMessageAsync(message);

Exam Trap: ServiceBusMessage constructor takes BinaryData, not string directly!


Containers ​

ACR Push Workflow (CORRECT ORDER) ​

  1. docker build - Build the image
  2. az acr login - Authenticate to ACR

Key Point: Tag image BEFORE pushing, login BEFORE push

Sidecar Containers ​

  • ACI Container Groups = Multiple containers on same host (sidecar pattern)
  • Kubernetes Pods = Also works, but ACI Container Groups is the Azure-native answer

App Service Container Deployment (az webapp) ​

bash
# Create web app from container
az webapp create --resource-group $rg --plan $plan --name $app \

# Configure container settings
az webapp config container set --name $app --resource-group $rg \

Event Grid ​

Enable Event Grid for Subscription ​

bash
# CORRECT - Register the provider
az provider register --namespace Microsoft.EventGrid

# WRONG - These don't register Event Grid:
# az group deployment create  (deploys templates, not providers)
# az group create  (creates resource groups only)
# az eventgrid topic create  (creates topic, doesn't register provider)

API Management ​

Quota Exceeded = 403 Forbidden ​

  • Set-usage-quota-by-key policy → Returns 403 when quota exceeded
  • NOT 429 (that's rate limiting)
  • Quota = Hard limit per time period
  • Rate limit = Requests per second throttling

APIM Policies for Access Control ​

PolicyPurposeHTTP Code
quota-by-keyLimit calls per period403 Forbidden
rate-limit-by-keyLimit calls per second429 Too Many Requests
validate-jwtValidate JWT tokens401 Unauthorized
restrict-caller-ipsIP allowlist/blocklist403 Forbidden

Azure Monitor and Application Insights ​

App Insights Telemetry for User Behavior ​

Capture these THREE for behavior analytics:

  1. Events - Track user actions (clicks, features used)
  2. User ID - Identify individual users
  3. Session ID - Track user sessions

DON'T capture for behavior:

  • Traces (developer debugging)
  • Exceptions (error tracking, not behavior)

App Service Autoscale Rules ​

Metric SourceWhat It Measures
Service Bus queueMessage count in queue
Metric nameMessageCount or ActiveMessageCount
OperatorGreaterThan or LessThan
ThresholdNumber of messages

Scale down trigger: Operator = LessThanOrEqual, compare to threshold


Security and identity ​

Managed Identity for VM Access ​

To use managed identity on a VM:

  1. Enable system-assigned identity on VM
  2. Grant Reader role at subscription scope (for resource group access)
  3. Use Azure CLI with az login --identity

NOT needed: Create identity manually, retrieve access token manually

Microsoft Entra ID + MFA for External Users ​

Required actions:

  1. Upgrade to Microsoft Entra ID P1 (MFA requires P1 license)
  2. Create conditional access policy (enforce MFA)

NOT needed:

  • Entra ID B2B (for guest users from other orgs)
  • Entra ID B2C (for consumer-facing apps)

User-Assigned vs System-Assigned Managed Identity ​

ScenarioUse This Identity Type
Single resource, lifecycle tied to resourceSystem-assigned
Multiple resources sharing same identityUser-assigned
Different permissions per deploymentUser-assigned
Immutable infrastructureUser-assigned

Cosmos DB and data ​

ASP.NET Memory Session State Provider ​

For session state that:

  • Shares across ASP.NET apps
  • Persists as snapshot
  • Handles concurrent access
  • Minimizes latency

Answer: ASP.NET Memory Session State Provider (NOT Cosmos DB, NOT SQL)


Quick reminders ​

  1. BinaryData - Service Bus messages use BinaryData.FromString(), not raw strings
  2. Same Region - Blob logging requires storage in SAME REGION as App Service
  3. 403 vs 429 - Quota exceeded = 403, Rate limit = 429
  4. FIFO vs LRU - FIFO = oldest first, LRU = least recently accessed
  5. Provider Register - az provider register --namespace Microsoft.EventGrid
  6. P1 License - MFA/Conditional Access requires Entra ID P1
  7. ClientCertificate - Access via HttpRequest.ClientCertificate, not headers

Personal study notes written from official documentation. Not affiliated with Microsoft or GitHub. Contains no exam questions.