AZ-305 · Domain 4: Design infrastructure solutions · 33% of the exam
Task 4.2: Design an application architecture
Service Bus, Event Grid and Event Hubs for messaging and events, API Management, Azure Managed Redis and Front Door caching, App Configuration, and automated deployment with Bicep and pipelines.
Study it
Messaging and events: Service Bus, Event Grid and Event Hubs
Automated deployment with Bicep, deployment stacks and pipelines
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the Microsoft documentation page that proves it.
Question 1 · choose 1
An order service sends commands to a fulfilment service. Commands for the same order must be processed in the order they were sent, a resent command must not be processed twice, and completing a command and sending a follow-up must happen atomically. Which messaging service should you recommend?
AAzure Queue Storage queues
BAzure Event Grid custom topics
CAzure Event Hubs with one partition per order
DAzure Service Bus queues with sessions and duplicate detection
Show the answer and why
AAzure Queue Storage queues
Incorrect
Queue Storage doesn't guarantee ordering and has no duplicate detection or transactions.
BAzure Event Grid custom topics
Incorrect
Event Grid isn't a command queue with ordering and transactions.
CAzure Event Hubs with one partition per order
Incorrect
Event Hubs is a telemetry stream; it has no per-message duplicate detection or transactional send and complete.
DAzure Service Bus queues with sessions and duplicate detection
Correct
Sessions give FIFO handling per order, duplicate detection drops resent messages, and Service Bus supports transactions.
Service Bus is an enterprise message broker. Message sessions provide ordered, first-in first-out handling of related messages, duplicate detection discards copies within a time window, and transactions group receive and send operations.
When a partner uploads an invoice blob to a container, a function must process it within seconds, and a webhook in another system must be notified. Only blobs ending in .pdf in that container matter. You want push delivery with no polling and no custom routing code. What should you recommend?
AAn Event Grid system topic for the storage account, with filtered subscriptions
BA function with a timer trigger that lists the container every minute
CEvent Hubs Capture on the storage account
DA Service Bus topic that the partners write to after each upload
Show the answer and why
AAn Event Grid system topic for the storage account, with filtered subscriptions
Correct
Blob storage publishes BlobCreated events to Event Grid, which pushes them to functions and webhooks with subject filters.
BA function with a timer trigger that lists the container every minute
Incorrect
A timer that lists the container is the polling the design avoids, and it must track what's new.
CEvent Hubs Capture on the storage account
Incorrect
Capture works on events already sent to an event hub; nothing is raised when partners upload blobs.
DA Service Bus topic that the partners write to after each upload
Incorrect
Asking partners to send a second message is custom work and can drift from what was actually uploaded.
Azure Storage emits blob events such as BlobCreated to Event Grid through a system topic. Event subscriptions push those events to handlers like Azure Functions and webhooks, and filters on subject or event type limit delivery to the blobs that matter.
You must publish 30 internal APIs to 200 partners through one endpoint. Each partner needs its own key, a call limit per minute, and a portal to read documentation and try the APIs. Backends must not change. Which service should you recommend?
AAzure Application Gateway with path-based routing rules
BAzure Front Door with a WAF rate-limiting rule
CAzure API Management with products, subscriptions and rate-limit policies
DAn Azure Functions app that forwards each call to the backends
Show the answer and why
AAzure Application Gateway with path-based routing rules
Incorrect
Application Gateway has no subscription keys, per-consumer quotas or developer portal.
BAzure Front Door with a WAF rate-limiting rule
Incorrect
WAF rate limits by client IP or similar attributes, not by partner key, and there's no developer portal.
CAzure API Management with products, subscriptions and rate-limit policies
Correct
API Management fronts many backends, issues subscription keys, enforces rate limits by key and includes a developer portal.
DAn Azure Functions app that forwards each call to the backends
Incorrect
A custom proxy would need its own key, quota and documentation code, all of which API Management provides.
API Management is an API gateway with a management plane and a developer portal. Products and subscriptions give each consumer a key, and policies such as rate-limit-by-key throttle calls per subscription without changing the backends.
Twelve microservices each keep their own settings files. You want one central store for settings and feature flags that apps refresh without redeploying, while connection secrets stay in Key Vault. What should you recommend?
AAzure Key Vault for every setting and feature flag
BAzure App Configuration with feature flags and Key Vault references
CApp settings on each App Service app, changed through the portal
DA JSON file in a blob container that each service downloads at startup
Show the answer and why
AAzure Key Vault for every setting and feature flag
Incorrect
Key Vault is built for secrets, keys and certificates, not for feature flags and plain settings read often.
BAzure App Configuration with feature flags and Key Vault references
Correct
App Configuration centralizes settings and feature flags, supports dynamic refresh, and references secrets kept in Key Vault.
CApp settings on each App Service app, changed through the portal
Incorrect
Per-app settings aren't a central store, and changing them restarts the app.
DA JSON file in a blob container that each service downloads at startup
Incorrect
A file read at startup needs a restart to pick up changes and has no feature flag tooling.
App Configuration is a managed service for application settings and feature flags. It complements Key Vault: settings can be Key Vault references, so secrets stay in the vault while apps read one central configuration.
A retail site runs on 20 App Service instances in one region. Catalog queries overload Azure SQL Database, and the catalog data must be read in under a millisecond and shared by every instance. Product images must load quickly for shoppers on several continents. Which two changes should you recommend? (Choose TWO.)
AAn in-memory cache inside each App Service instance
BRead scale-out replicas on the SQL database for catalog queries
CAzure Managed Redis used as a cache-aside store for catalog data
DAzure Front Door with caching enabled for the image paths
EImages moved to an Azure Files share mounted by every instance
Show the answer and why
AAn in-memory cache inside each App Service instance
Incorrect
Each instance would hold its own copy, so the cache isn't shared and instances serve different data.
BRead scale-out replicas on the SQL database for catalog queries
Incorrect
A database replica still serves queries at database latency, not in under a millisecond.
CAzure Managed Redis used as a cache-aside store for catalog data
Correct
A shared in-memory Redis cache serves reads in under a millisecond for every instance and takes load off the database.
DAzure Front Door with caching enabled for the image paths
Correct
Front Door caches static content at edge locations close to shoppers around the world.
EImages moved to an Azure Files share mounted by every instance
Incorrect
A file share in one region doesn't bring images closer to shoppers on other continents.
The cache-aside pattern loads data into a shared cache on demand; Azure Managed Redis, which replaces Azure Cache for Redis for new designs, gives sub-millisecond reads to every instance. Front Door caching serves static content from edge locations near users.
Dozens of services already produce and consume events with Apache Kafka client libraries against a self-managed cluster. The company wants a managed Azure service for the event stream without changing client code beyond configuration, and without running brokers. What should you recommend?
AAzure Service Bus Premium topics
BAzure Event Hubs, using its Apache Kafka endpoint
CAzure Queue Storage
DKafka on AKS managed by the team
Show the answer and why
AAzure Service Bus Premium topics
Incorrect
Service Bus doesn't speak the Kafka protocol, so the clients would need rewriting.
BAzure Event Hubs, using its Apache Kafka endpoint
Correct
Event Hubs exposes a Kafka-compatible endpoint, so existing Kafka clients connect by changing configuration only.
CAzure Queue Storage
Incorrect
Queue Storage isn't Kafka-compatible and isn't an event stream with partitions and consumer groups.
DKafka on AKS managed by the team
Incorrect
Running Kafka on AKS means the team still operates the brokers.
Azure Event Hubs provides an Apache Kafka endpoint on a namespace, so Kafka producers and consumers can use Event Hubs with a configuration change, without managing Kafka clusters.
An order service publishes order messages once. Billing must get every order, the warehouse only orders with shipping required, and fraud review only orders over 10,000 USD. Each consumer must process its messages reliably at its own pace, and the publisher must not know the consumers. What should you recommend?
AA Service Bus topic with a subscription per consumer and filter rules
BOne Service Bus queue that all three consumers read from
CThree Service Bus queues that the publisher writes to separately
DAn Event Hubs event hub with three consumer groups
Show the answer and why
AA Service Bus topic with a subscription per consumer and filter rules
Correct
Each subscription gets a copy of matching messages, and SQL or correlation filters select the subset per consumer.
BOne Service Bus queue that all three consumers read from
Incorrect
Consumers on one queue compete for messages, so each order goes to only one of them.
CThree Service Bus queues that the publisher writes to separately
Incorrect
The publisher would have to know every consumer and its rules.
DAn Event Hubs event hub with three consumer groups
Incorrect
Consumer groups read the whole stream; there are no per-consumer message filters.
Service Bus topics and subscriptions provide one-to-many publish and subscribe. Each subscription keeps its own copy of messages, and filter rules (SQL or correlation filters) decide which messages each subscription receives.
A web app on App Service is released weekly. Releases must not cause downtime or cold starts for users, and if a release misbehaves the previous version must be back within a minute. What should you recommend?
ADeploy straight to production during a maintenance window
BDeploy to a staging slot, then swap it into production
CCreate a new App Service app for each release and update DNS
DRestore from an App Service backup when a release fails
Show the answer and why
ADeploy straight to production during a maintenance window
Incorrect
Deploying into production restarts the app and gives no quick way back.
BDeploy to a staging slot, then swap it into production
Correct
A swap warms up the staging instances first, and swapping again restores the previous version quickly.
CCreate a new App Service app for each release and update DNS
Incorrect
DNS changes take time to spread, so rollback isn't immediate.
DRestore from an App Service backup when a release fails
Incorrect
Restoring a backup takes much longer than a minute and overwrites content.
Deployment slots let you deploy to a staging slot, warm it up and swap it with production without downtime. After a swap, the previous production version sits in the staging slot, so swapping back rolls the release back.
A platform team deploys each app environment from a Bicep file. When a resource is removed from the file, it must be deleted from Azure on the next deployment, and nobody may delete the managed resources outside the pipeline. Complete mode is being phased out. What should you recommend?
ADeployment stacks that delete unmanaged resources and deny deletes
BIncremental-mode deployments with a CanNotDelete lock on each resource group
CTemplate specs that store versioned copies of the Bicep file
DComplete-mode deployments to each resource group
Show the answer and why
ADeployment stacks that delete unmanaged resources and deny deletes
Correct
A stack deletes resources that leave the file and can deny deletes of its managed resources by anyone outside the stack.
BIncremental-mode deployments with a CanNotDelete lock on each resource group
Incorrect
Incremental mode never deletes resources that leave the file, and a lock would block the pipeline's own deletes too.
CTemplate specs that store versioned copies of the Bicep file
Incorrect
Template specs don't delete resources that are removed from a template.
DComplete-mode deployments to each resource group
Incorrect
Complete mode deletes extra resources but isn't recommended and is being gradually deprecated in favor of deployment stacks.
A deployment stack manages a group of resources as one unit. Its actionOnUnmanage setting deletes resources removed from the template, and deny settings such as denyDelete stop changes made outside the stack. Microsoft recommends stacks instead of complete mode.