Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Revision pack

AI-200 cheat sheet

One sheet per exam area, made from the 28 lessons on this site. Print it, save it as a PDF, or press Listen and revise on a walk. Each line links back to its lesson if something doesn't make sense.

⏰ The last 30 minutes before the exam

Don't learn anything new now. Read this once, then put it away.

In the exam room

  • You have about 100 minutes for the questions. The pass mark is 700 on a scale of 1–1000, which isn't the same as 70% of questions right.
  • Answer every question. There's no penalty for a wrong guess, but a blank always scores zero.
  • Mark anything you're unsure of for review and move on. Come back at the end with fresh eyes.
  • If a section warns that you can't return to it, believe it. Review everything before you leave.
  • Read the last line of a long scenario first, so you know what you're looking for.
  • Watch for "least", "most cost-effective" and "minimise administrative effort". They decide which correct-looking option is the right one.

Look-alikes people mix up

App Service vs Container Apps vs AKS
“Scale to zero on Service Bus queue length without managing a cluster” = Container Apps + KEDA. “Apply Deployment and Service manifests” = AKS. “Supply environment variables from app settings” = App Service.
Cosmos DB vs PostgreSQL vs Redis for Vector Search
“Add vector search to an existing PostgreSQL app” = pgvector. “Detect new items to embed them” = Cosmos DB change feed. “Reuse answers to similar questions” = Redis semantic cache.
Azure Service Bus vs Event Grid
“Messages that fail repeatedly must be kept for inspection” = Service Bus dead-letter queue. “Route only events whose subject ends with .pdf” = Event Grid subject filter.
Key Vault vs App Configuration
“Change a secret without redeploying” = a new Key Vault secret version (apps read the latest). “Turn a feature on without redeploying” = App Configuration feature flag.

Domain 1: Containers (20–25% of the exam)

Containers for AI Apps: App Service, Container Apps or AKS?

A container image packs your AI app and everything it needs (Python, packages, code) into one versioned unit that you store in Azure Container Registry. You then pick a host: App Service for a single web API with the least work, Azure Container Apps for serverless microservices with revisions and KEDA scaling to zero, or Azure Kubernetes Service (AKS) when you need full Kubernetes control through manifest files.

  • A container image bundles code, runtime and dependencies; a registry such as ACR stores and versions it.
  • App Service runs one container as a web app; app settings become environment variables.
  • Container Apps runs serverless containers in an environment, with revisions, traffic splitting and KEDA scaling (including to zero).

🎯 Exam tip: "Scale to zero on queue messages" or "split traffic between versions" = Azure Container Apps.

⚠️ Watch out: Picking AKS for a single API when nobody needs direct Kubernetes access.

Azure Container Registry: Store, Tag and Manage Images

Azure Container Registry (ACR) is a private registry at myreg.azurecr.io (your registry name plus azurecr.io) that stores images in repositories. A tag (ragapi:1.4.0) is a movable label, while a digest (sha256:…) identifies the exact image and never changes. You push with docker push after az acr login, copy public images in with az acr import, list versions with az acr repository show-tags, and let hosts pull with a managed identity that has the AcrPull role.

  • Image names are login-server/repository:tag, for example myreg.azurecr.io/ragapi:1.4.0.
  • Tags move; digests don't. Use unique tags (version, build ID, commit) for deployments.
  • az acr login signs Docker in with your Entra ID identity; the admin account is off by default.

🎯 Exam tip: "Copy an image from Docker Hub or another registry without Docker installed" = az acr import.

⚠️ Watch out: Deploying :latest to production and losing track of which build is running.

Build and Run Images with ACR Tasks

ACR Tasks build, test and patch container images inside Azure Container Registry, so you don't need Docker on your machine. A quick task (az acr build) sends your folder to Azure and pushes the result. An automated task (az acr task create with --context and --file) runs on a source code commit, a base image update or a schedule. A multi-step task uses a YAML file to build, run and push several images in one go.

  • az acr build is a quick task that builds in the cloud and pushes to the registry.
  • az acr task create saves a task; --context is the git repo or folder and --file is the Dockerfile or YAML.
  • Triggers are source code commit, base image update and schedule (cron, UTC).

🎯 Exam tip: "Build without Docker installed" = az acr build.

⚠️ Watch out: Forgetting the trailing dot (the build context) in az acr build.

Run a Container on App Service with Settings and Secrets

App Service can run a custom container image from Azure Container Registry, pulled with a managed identity that has AcrPull. Every app setting you add (az webapp config appsettings set) reaches the container as an environment variable, and WEBSITES_PORT tells App Service which port your app listens on. For secrets, make the setting a Key Vault reference, @Microsoft.KeyVault(SecretUri=...), so the value is read from Key Vault at run time and never stored in the image or the setting.

  • App Service runs one custom container image per app from ACR or another registry.
  • App settings become environment variables inside the container; changing them restarts the app.
  • Set WEBSITES_PORT when the container listens on a port other than the one App Service detects.

🎯 Exam tip: "Supply configuration to the container without rebuilding" = app settings (environment variables).

⚠️ Watch out: Baking API keys into the image or committing them in a .env file.

Azure Container Apps: Environments and Revisions

Azure Container Apps runs containers without a cluster to manage. Apps live in an environment, a secure boundary with its own network and Log Analytics workspace. Any change to the app's template (image, environment variables, scale rules) creates a new revision, an immutable snapshot. In multiple revision mode you split traffic between revisions with az containerapp ingress traffic set, for example 80% to the old one and 20% to the new one, then roll forward or back.

  • An environment groups container apps with a shared network and Log Analytics workspace.
  • az containerapp create or up deploys an image; --env-vars, --secrets and secretref connect configuration.
  • Revision-scope changes (template) create a revision; application-scope changes (ingress, secrets) don't.

🎯 Exam tip: "Gradually move users to a new version" = multiple revision mode + traffic splitting.

⚠️ Watch out: Expecting a secret change to reach running revisions without a restart or new revision.

Event-Driven Scaling with KEDA in Container Apps

Azure Container Apps scales with KEDA (Kubernetes Event-driven Autoscaling). You add a scale rule: HTTP (concurrent requests), TCP, or a custom KEDA scaler such as azure-servicebus with metadata like queueName and messageCount. Replicas grow as the queue fills, up to --max-replicas, and shrink after the queue empties, down to --min-replicas, which can be 0. The scaler authenticates with a secret (--scale-rule-auth) or a managed identity.

  • Container Apps scale rules are HTTP, TCP or custom (any KEDA scaler, such as azure-servicebus or azure-queue).
  • Replicas stay between --min-replicas and --max-replicas; min 0 allows scale to zero.
  • Service Bus rules use metadata queueName (or topicName and subscriptionName), namespace and messageCount.

🎯 Exam tip: "Scale based on the number of messages in a queue" = custom KEDA rule (azure-servicebus or azure-queue).

⚠️ Watch out: Setting max replicas too low, so a big backlog drains slowly.

Deploy to AKS with Manifest Files

On Azure Kubernetes Service (AKS) you describe your app in YAML manifest files and send them with kubectl apply -f. A Deployment says which image to run, how many replicas, which resources, probes and environment variables. A Service gives the pods a stable address (ClusterIP inside the cluster, LoadBalancer for a public IP). Kubernetes keeps the real state equal to what you declared, so a dead pod is replaced and a new image tag rolls out pod by pod.

  • az aks get-credentials writes kubeconfig so kubectl can talk to the cluster.
  • --attach-acr gives the kubelet identity AcrPull on the registry.
  • A Deployment declares image, replicas, resources, probes and env; its selector must match the pod template labels.

🎯 Exam tip: "Expose the app with a public IP" = Service type: LoadBalancer.

⚠️ Watch out: A Service selector that doesn't match the pod labels, so the Service has no endpoints.

Troubleshoot AKS and Container Apps: Logs, Events, Connectivity

When a container app breaks, check three places. Logs show what your app said: kubectl logs (add --previous for a crashed container) on AKS, az containerapp logs show --type console on Container Apps. Events show what the platform did: kubectl describe pod and kubectl get events on AKS, --type system logs on Container Apps. Connectivity checks (Service endpoints, ports, DNS, ingress) show whether traffic can reach the app. In Log Analytics, Container Apps logs land in ContainerAppConsoleLogs_CL and ContainerAppSystemLogs_CL.

  • Logs (what the app said), events (what the platform did), connectivity (can traffic reach it).
  • kubectl logs --previous reads the last crashed container; kubectl describe pod shows its events.
  • ImagePullBackOff = wrong image or no AcrPull; check with az aks check-acr.

🎯 Exam tip: "Why can't the pod start or pull its image?" = kubectl describe pod / kubectl get events.

⚠️ Watch out: Running kubectl logs on a CrashLoopBackOff pod without --previous and seeing nothing useful.

Domain 2: Data for AI (30–35% of the exam)

Embeddings and Vector Search for Developers

An embedding is a list of numbers (a vector) that an embedding model such as text-embedding-3-small (1,536 dimensions) produces from text, so that texts with similar meaning get vectors that sit close together. Vector search embeds the user's question with the same model, then asks the database for the stored vectors with the smallest distance (usually cosine), and an index such as DiskANN or HNSW makes that fast. On Azure you can store and search vectors in Cosmos DB for NoSQL, PostgreSQL with pgvector and Azure Managed Redis.

  • An embedding model turns text into a vector; similar meaning gives close vectors.
  • text-embedding-3-small returns 1,536 dimensions by default; text-embedding-3-large returns 3,072.
  • Embed documents and questions with the same model and the same dimensions.

🎯 Exam tip: "Find items with similar meaning, not matching words" = vector search over embeddings.

⚠️ Watch out: Embedding the query with a different model, or different dimensions, from the stored documents.

Cosmos DB for NoSQL: Connect with the SDK and Query

You connect with the azure-cosmos Python SDK by creating a CosmosClient from the account endpoint and DefaultAzureCredential, then getting a database and a container. Write items with upsert_item, fetch one item cheaply with a point read (read_item with its id and partition key, about 1 RU for a 1 KB item), and use query_items with parameters for everything else. Pass partition_key to keep a query inside one logical partition; a query without it fans out across partitions and costs more Request Units.

  • CosmosClient(url, credential=DefaultAzureCredential()) signs in with Microsoft Entra ID.
  • Entra ID data access needs a Cosmos DB data plane role such as Cosmos DB Built-in Data Contributor.
  • A container's partition key is set at creation and can't be changed.

🎯 Exam tip: "Retrieve one item with the lowest RU cost" = read_item with id and partition key.

⚠️ Watch out: Running SELECT * FROM c WHERE c.id = @id instead of a point read.

Cosmos DB: RUs, Indexing Policies and Consistency Levels

Every Cosmos DB operation costs Request Units (RUs): about 1 RU for a 1 KB point read, more for writes and queries. By default the indexing policy indexes every property, which makes filters cheap but writes expensive, so you exclude paths you never filter on (such as a big /embedding/* array) and add composite indexes for multi-property ORDER BY. Consistency levels trade freshness for cost and latency: Strong, Bounded staleness, Session (the default), Consistent prefix and Eventual. Strong and Bounded staleness reads cost about twice the RUs of the weaker levels.

  • A point read of 1 KB costs about 1 RU; writes and queries cost more.
  • The default indexing policy indexes every path (/*) and excludes /_etag.
  • Exclude large paths you never filter on (like /embedding/*) to cut write RUs.

🎯 Exam tip: "Reduce RU cost of writes" = exclude paths in the indexing policy.

⚠️ Watch out: Leaving a 1,536-number embedding array in the range index.

Vector Search in Cosmos DB for NoSQL

To search vectors in Azure Cosmos DB for NoSQL, you create the container with a vector embedding policy (the vector path, dataType such as float32, dimensions such as 1536, and distanceFunction such as cosine) and add a vector index (flat, quantizedFlat or diskANN) to its indexing policy, excluding the vector path from the range index. You store each embedding inside the item, then run SELECT TOP k ... ORDER BY VectorDistance(c.embedding, @q) to get the most similar items first.

  • Vector embedding policy: path, dataType (float32, float16, int8, uint8), dimensions (default 1536), distanceFunction (cosine default, dotproduct, euclidean).
  • Vector index types: flat (exact, max 505 dims), quantizedFlat (max 4,096), diskANN (approximate, max 4,096).
  • quantizedFlat and diskANN need at least 1,000 vectors before the index is used; below that it's a full scan.

🎯 Exam tip: "Exact results, small vectors (≤ 505 dimensions)" = flat.

⚠️ Watch out: Using a flat index for 1,536-dimension vectors.

Cosmos DB Change Feed Processor

The change feed is a persistent, ordered record of the inserts and updates in a Cosmos DB container. The change feed processor reads it for you: it watches the monitored container, hands each batch of changes to your delegate, and stores its progress in a lease container, so several instances can share the work and resume after a crash with at-least-once delivery. The default latest version mode doesn't capture deletes; all versions and deletes mode does. An Azure Functions Cosmos DB trigger gives you the same pattern without hosting the processor yourself.

  • Four parts: monitored container, lease container, compute instance, delegate.
  • The processor gives at-least-once delivery; make the delegate idempotent.
  • By default it starts from now; WithStartTime reads from a time or from the beginning (latest version mode only).

🎯 Exam tip: "Track progress and share work across instances" = the lease container.

⚠️ Watch out: Expecting deletes to appear in latest version mode.

Connect to and Query Azure Database for PostgreSQL

You connect to Azure Database for PostgreSQL flexible server from Python with psycopg (version 3). Instead of a stored password, you get a Microsoft Entra token from DefaultAzureCredential for the scope https://ossrdbms-aad.database.windows.net/.default and pass it as the password, with your Entra user or managed identity name as the user and sslmode=require. Then you run SQL with parameterised queries (%s placeholders), never by pasting user input into the SQL string.

  • Use psycopg 3 (import psycopg) with host, dbname, user, password, port 5432 and sslmode=require.
  • For passwordless sign-in, DefaultAzureCredential gets a token for https://ossrdbms-aad.database.windows.net/.default and you pass it as the password.
  • An Entra admin on the server must create a database role for each Entra user, group or managed identity.

🎯 Exam tip: "Connect without storing a password" = Microsoft Entra token from DefaultAzureCredential used as the password.

⚠️ Watch out: Building SQL with f-strings or + from user input, which opens the door to SQL injection.

PostgreSQL Schemas, Data Types and Indexes

A good AI table in Azure Database for PostgreSQL keeps each fact in the right type: uuid or bigint keys, text for chunks, jsonb for flexible metadata, timestamptz for times and vector(1536) (from the pgvector extension) for embeddings. You first add vector to the azure.extensions server parameter, then run CREATE EXTENSION vector. Then you index for the way you query: B-tree for equality and ranges, GIN for jsonb, and HNSW or IVFFlat for vectors, and you prove it works with EXPLAIN ANALYZE.

  • Allow-list vector in azure.extensions, then CREATE EXTENSION vector in each database that needs it.
  • Pick types on purpose: uuid or bigint keys, text, jsonb, timestamptz, vector(n) or halfvec(n).
  • B-tree for equality, ranges and sorting. GIN for jsonb and full-text. HNSW or IVFFlat for vectors.

🎯 Exam tip: "Extension not allowed" error = add it to azure.extensions first.

⚠️ Watch out: Running CREATE EXTENSION vector before adding vector to azure.extensions.

pgvector Similarity Search and RAG with Metadata Filters

With pgvector you store each chunk's embedding in a vector(1536) column, embed the user's question with the same model, and run ORDER BY embedding <=> %s LIMIT 5 to get the closest chunks by cosine distance. For retrieval-augmented generation (RAG) you add a metadata filter in the WHERE clause (such as tenant_id or lang), send those chunks to the model as context, and tell it to answer only from them. An HNSW index keeps the search fast, and hnsw.ef_search trades speed for recall.

  • Embed documents and questions with the same model and dimensions.
  • Nearest chunks: ORDER BY embedding <=> query_vector LIMIT k (smaller distance = closer).
  • Put metadata filters (tenant_id, lang, product) in the WHERE clause of the same query.

🎯 Exam tip: "Return the 5 most similar items" = ORDER BY embedding <=> @q LIMIT 5.

⚠️ Watch out: Treating <=> as similarity and sorting DESC, which returns the least similar chunks first.

Size and Tune PostgreSQL for Vector Workloads

Vector search on Azure Database for PostgreSQL is hungry for memory: HNSW indexes are fastest when they fit in RAM, so busy vector workloads usually run on General Purpose or Memory Optimized compute, not Burstable. Raise maintenance_work_mem for index builds, tune m and ef_construction (HNSW) or lists (IVFFlat, built after loading data), and size IOPS with Premium SSD v2. For throughput, reuse connections with psycopg_pool in the app and the built-in PgBouncer on port 6432.

  • Burstable is for dev and test; vector workloads belong on General Purpose or Memory Optimized.
  • HNSW is fastest when the index fits in memory. Memory Optimized gives the most RAM per vCore.
  • Load data first, then build the index, with a higher maintenance_work_mem and parallel workers.

🎯 Exam tip: "Speed up CREATE INDEX for HNSW" = raise maintenance_work_mem (and parallel maintenance workers).

⚠️ Watch out: Building an IVFFlat index on an empty table, so its clusters are learned from no data.

Azure Managed Redis: Caching, Expiration and Invalidation

Azure Managed Redis is an in-memory store based on Redis Enterprise. With cache-aside, your app checks Redis first; on a miss it reads the database (or calls the model), then saves the result with a TTL using SET key value EX 300. When the source data changes, you invalidate by deleting the key so the next read loads fresh data. In Python you connect with redis-py on port 10000 over TLS, using Microsoft Entra ID through redis-entraid (or an access key if enabled), and an eviction policy decides what goes when memory fills.

  • Azure Managed Redis is based on Redis Enterprise; tiers are Memory Optimized, Balanced, Compute Optimized and Flash Optimized.
  • Connect on port 10000 with TLS. Entra ID via redis-entraid is preferred; access keys are disabled by default on new caches.
  • Cache-aside: GET, on a miss load from the source, then SET with EX seconds.

🎯 Exam tip: "Load into the cache only when requested" = cache-aside.

⚠️ Watch out: Caching without a TTL, so stale data and memory use grow forever.

Vector Search with Azure Managed Redis

Azure Managed Redis does vector search through the RediSearch module, which you must select when you create the cache (with Redis 7.4) along with the Enterprise or Non-clustered clustering policy. You store embeddings as FLOAT32 bytes in hashes, create an index with FT.CREATE ... SCHEMA ... VECTOR HNSW (or FLAT) TYPE FLOAT32 DIM 1536 DISTANCE_METRIC COSINE, and query with FT.SEARCH using =>[KNN 3 @embedding $vec] and DIALECT 2. A common use is a semantic cache that returns a saved answer when a new question means the same thing.

  • RediSearch must be selected at cache creation (Redis 7.4) and needs Enterprise or Non-clustered clustering, not OSS.
  • Store vectors as raw FLOAT32 bytes, for example numpy.astype(np.float32).tobytes().
  • FT.CREATE idx ON HASH PREFIX 1 doc: SCHEMA ... embedding VECTOR HNSW 6 TYPE FLOAT32 DIM 1536 DISTANCE_METRIC COSINE

🎯 Exam tip: "Vector index in Azure Managed Redis" = RediSearch module, chosen at creation.

⚠️ Watch out: Creating the cache without RediSearch, or with the OSS clustering policy, then trying to run FT.CREATE.

Domain 3: Messaging & Functions (20–25% of the exam)

Azure Service Bus Queues: Send, Receive and Settle Messages

An Azure Service Bus queue holds messages until one receiver takes each one, so a web API can hand slow AI work to a background worker. In Python you create a ServiceBusClient with the fully qualified namespace and DefaultAzureCredential, send a ServiceBusMessage with a queue sender, and read with a queue receiver. In the default peek-lock mode the receiver must complete the message when it's done; abandon makes it available again, and after the max delivery count (10 by default) it goes to the dead-letter queue.

  • A queue delivers each message to one receiver (competing consumers).
  • ServiceBusClient(fully_qualified_namespace, DefaultAzureCredential()) then get_queue_sender and get_queue_receiver.
  • Peek-lock is the default. Settle with complete_message, abandon_message, dead_letter_message or defer_message.

🎯 Exam tip: "Message must not be lost if the worker fails" = peek-lock, then complete after processing.

⚠️ Watch out: Forgetting to complete the message in peek-lock mode, so it comes back again and again until it's dead-lettered.

Service Bus Topics, Subscriptions and Dead-Letter Queues

A Service Bus topic is a queue with many readers: every subscription gets its own copy of each message, and filters decide which messages a subscription keeps. SQL filters use a condition such as tier = 'premium'; correlation filters match exact property values and are cheaper to evaluate. Messages that can't be processed land in the dead-letter queue (DLQ), a sub-queue you read in Python with sub_queue=ServiceBusSubQueue.DEAD_LETTER, fix and resubmit.

  • A topic copies each message to every subscription whose rules match.
  • New subscriptions start with the $Default true filter. Replace it with a SQL or correlation filter.
  • Correlation filters match exact values and are cheaper. SQL filters allow conditions like > and LIKE.

🎯 Exam tip: "Each service needs its own copy of the message" = topic + subscriptions.

⚠️ Watch out: Adding a filter but leaving the $Default rule, so the subscription still gets every message.

Azure Event Grid: Custom Events, Filters and Retries

Azure Event Grid pushes small events ("a blob was created", "a summary is ready") to handlers such as Azure Functions, webhooks and Service Bus. You publish your own events to a custom topic with EventGridPublisherClient, using the CloudEvents 1.0 or Event Grid schema. An event subscription picks the handler and uses filters (event types, subject begins with / ends with, advanced filters on data). If delivery fails, Event Grid retries with backoff, by default up to 30 attempts within 1,440 minutes (24 hours), then drops the event unless dead-lettering to a storage container is set.

  • Event Grid pushes events to handlers. Topics receive events, event subscriptions route them.
  • Custom topics take your own events. Use CloudEvents 1.0 (recommended) or the Event Grid schema.
  • Publish in Python with EventGridPublisherClient and DefaultAzureCredential (EventGrid Data Sender role) or the topic key.

🎯 Exam tip: "React when a .jpg lands in a container" = Event Grid with a subject ends with filter.

⚠️ Watch out: Thinking Event Grid stores events for you to pull later. Standard topics push, and drop what can't be delivered unless dead-lettering is on.

Azure Functions: Serverless APIs with Triggers and Bindings

An Azure Function is a small piece of code that runs when its trigger fires: an HTTP request, a Service Bus message, an Event Grid event, a timer or a Cosmos DB change. Each function has exactly one trigger. Bindings connect inputs and outputs without client code, so an HTTP API can drop a message on a queue through an output binding. In the Python v2 programming model you write everything in function_app.py with decorators on func.FunctionApp(), such as @app.route, @app.service_bus_queue_trigger and @app.service_bus_queue_output.

  • One trigger per function. Bindings (input and output) are optional and can be many.
  • Python v2 - function_app.py, app = func.FunctionApp(), decorators per function. No function.json.
  • HTTP - @app.route with auth levels ANONYMOUS, FUNCTION, ADMIN.

🎯 Exam tip: "Start when a message lands in a queue" = Service Bus queue trigger.

⚠️ Watch out: Putting the connection string straight into the decorator instead of an app setting name.

Configure and Deploy Function Apps

A function app is configured in three places: host.json (runtime behaviour for every function, deployed with the code), app settings (environment variables in Azure, replacing local.settings.json, which never gets deployed) and the hosting plan. Flex Consumption is the recommended serverless plan: it scales to zero, adds always-ready instances if you want no cold starts and supports virtual networks. You create one with az functionapp create --flexconsumption-location and deploy with func azure functionapp publish or a zip deploy. Identity-based connections replace connection strings with settings like ServiceBusConnection__fullyQualifiedNamespace.

  • host.json = runtime settings for all functions, deployed with the code. local.settings.json = local only, never published.
  • In Azure, settings are app settings (environment variables). Use Key Vault references for secrets.
  • Identity-based connections - <name>__fullyQualifiedNamespace plus a data role on the managed identity.

🎯 Exam tip: "Serverless, scale to zero, VNet, avoid cold starts" = Flex Consumption with always-ready instances.

⚠️ Watch out: Expecting local.settings.json to be deployed.

Domain 4: Secure & Monitor (20–25% of the exam)

Azure Key Vault: Retrieve and Rotate Secrets

Azure Key Vault keeps secrets such as API keys and connection strings out of your code. Your app signs in with a managed identity through DefaultAzureCredential, needs the Key Vault Secrets User role, and reads the value with SecretClient.get_secret(). Every set_secret() creates a new version, so rotation means writing a new version (often from a function triggered by the Event Grid SecretNearExpiry event) while apps that ask for the latest version pick it up without a redeploy.

  • Key Vault stores secrets, keys and certificates. Apps read secrets at run time.
  • SecretClient(vault_url, credential) with DefaultAzureCredential: get_secret, set_secret, list_properties_of_secret_versions.
  • Use Azure RBAC (Key Vault Secrets User for apps, Secrets Officer for rotation) rather than legacy access policies.

🎯 Exam tip: "Read secrets with no credentials in code" = managed identity + DefaultAzureCredential.

⚠️ Watch out: Giving the app Key Vault Reader and wondering why get_secret fails. Reader sees metadata, not values.

Azure App Configuration: Settings and Feature Flags

Azure App Configuration is a central store for app settings. Each setting is a key-value with an optional label (such as prod) and a content type. Feature flags live under the .appconfig.featureflag/ prefix, and Key Vault references point at secrets without storing them. In Python, load() from azure-appconfiguration-provider reads the keys you select, trims prefixes, resolves Key Vault references with a keyvault_credential, and refreshes when a sentinel key changes.

  • Settings are key-values with optional labels and content types.
  • Feature flags are key-values under .appconfig.featureflag/.
  • Key Vault references store a secret URI. The app's provider fetches the secret with its own identity.

🎯 Exam tip: "Same key, different value per environment" = labels.

⚠️ Watch out: Putting secret values straight into App Configuration instead of Key Vault references.

Distributed Tracing with OpenTelemetry

Distributed tracing follows one request across every service it touches. OpenTelemetry records each step as a span, and every span in the request shares one trace ID, passed between services in the W3C traceparent header. In Python, install azure-monitor-opentelemetry and call configure_azure_monitor() with your Application Insights connection string. Requests, Flask, FastAPI, Django, psycopg2 and Azure SDK calls are traced automatically, and tracer.start_as_current_span() adds your own spans.

  • A trace is one request; spans are its steps; all spans share a trace ID.
  • W3C traceparent carries the trace ID and parent span ID between services.
  • pip install azure-monitor-opentelemetry, then configure_azure_monitor() at startup.

🎯 Exam tip: "Send OpenTelemetry data from Python to Application Insights with least code" = azure-monitor-opentelemetry + configure_azure_monitor().

⚠️ Watch out: Calling configure_azure_monitor() after the web framework is already imported and serving, so early requests aren't traced.

KQL Queries for Logs and Metrics

Kusto Query Language (KQL) asks questions of the logs in Application Insights and Log Analytics. A query starts with a table and pipes rows through operators: where filters, project picks columns, extend adds columns, summarize aggregates (count(), avg(), percentile()) usually by bin(timestamp, 5m), and render timechart draws it. A log search alert runs a KQL query on a schedule; a metric alert watches a numeric metric in near real time.

  • A query starts with a table; each | passes rows to the next operator.
  • where filters, project picks columns, extend adds computed columns.
  • summarize aggregates with count(), avg(), percentile(), dcount() by one or more columns.

🎯 Exam tip: "Count failures in 5-minute intervals" = summarize count() by bin(timestamp, 5m).

⚠️ Watch out: Using timestamp and success in a workspace query, where the columns are TimeGenerated and Success.

Install MSDEVBUILD Azure

Free · no account · works offline

Save the whole course for offline ›

Hi, I’m your Nimbus

Your study buddy. Pick what we do next.

MSDEVBUILD · Multi-Stack Dev Build

Sign in to MSDEVBUILD

One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.