Microsoft AZ-204 Practice Test Questions and Exam Dumps Part 17 Q321-340

View Full Microsoft AZ-204 Exam Dumps and Practice Test Dumps

 

Q321. An Azure Service Bus queue processes messages in order, and multiple consumers need to work on related messages as a unit. Which feature should be used?

1) Duplicate detection
2) Message sessions
3) Dead-letter queues
4) Scheduled messages

Correct Answer: 2)

Explanation:

Service Bus message sessions allow related messages to be grouped and processed together by a single consumer. When a queue or subscription is configured for sessions, messages containing the same session identifier can be handled sequentially while maintaining their logical relationship. This is useful for workflows such as order processing, where several messages belong to the same transaction or customer operation. Session-aware receivers can also maintain state associated with the session. Duplicate detection, dead-lettering, and scheduled delivery solve different messaging requirements and do not provide the same grouping and ordered-processing capabilities as message sessions.

Q322. An application sends the same message to an Azure Service Bus queue multiple times because of a retry operation. Which feature can prevent duplicate messages from being stored within a configured time window?

1) Duplicate message detection
2) Message sessions
3) Auto-forwarding
4) Topic filtering

Correct Answer: 1)

Explanation:

Azure Service Bus duplicate message detection helps prevent the same message from being accepted more than once when duplicate detection is enabled. Service Bus identifies messages using their message identifiers and maintains a history for a configured duplicate detection window. If the same message is submitted again during that period, the duplicate can be discarded rather than being delivered as a separate message. This feature is particularly useful when applications retry sends because of uncertain network conditions. Sessions provide ordered grouping, filters control subscription delivery, and auto-forwarding moves messages between entities, so they do not specifically address duplicate submissions.

Q323. A Service Bus consumer cannot successfully process certain messages after several delivery attempts. The development team wants those messages separated for later investigation. Which feature should be used?

1) Sessions
2) Scheduled messages
3) Dead-letter queue
4) Duplicate detection

Correct Answer: 3)

Explanation:

The Azure Service Bus dead-letter queue is designed to hold messages that cannot be successfully processed or that meet specific dead-lettering conditions. Instead of allowing a problematic message to repeatedly interfere with normal processing, the message can be moved to the dead-letter subqueue for inspection, correction, or later processing. Applications can explicitly dead-letter messages, while Service Bus can also dead-letter messages under certain conditions. This approach supports operational troubleshooting and prevents repeatedly failing messages from remaining in the primary processing path. Sessions and duplicate detection address different messaging requirements, while scheduled messages control delivery timing.

Q324. A Service Bus topic has several subscriptions. One subscription should receive only messages where the Region property equals West. What should the developer configure?

1) A message session
2) A dead-letter queue
3) Duplicate detection
4) A subscription rule/filter

Correct Answer: 4)

Explanation:

Service Bus topic subscriptions can use rules and filters to determine which messages are delivered to a particular subscription. A filter can evaluate message properties, such as a custom Region property, and allow only messages matching a condition such as Region = ‘West’. This supports publish-subscribe architectures where different consumers need different subsets of the same message stream. The filtering occurs at the subscription level rather than requiring publishers to send separate messages to each consumer. Sessions provide ordered processing, dead-letter queues isolate failed messages, and duplicate detection prevents repeated message submissions.

Q325. An application receives a Service Bus message but wants to keep the message available until processing is successfully completed. Which receive mode should be used?

1) ReceiveAndDelete
2) PeekOnly
3) PeekLock
4) SendAndLock

Correct Answer: 3)

Explanation:

The PeekLock receive mode allows an application to retrieve a Service Bus message while temporarily locking it so other consumers cannot process it simultaneously. The application can then complete the message after successful processing. If processing fails, the application can abandon the message or allow the lock to expire, making the message available for another delivery attempt. This behavior provides protection against losing messages when processing fails. ReceiveAndDelete removes the message immediately when received, which can result in message loss if processing fails. PeekLock is therefore the appropriate choice for reliable message processing.

Q326. An application needs a Service Bus message to become available for processing at a specific future time. Which feature should the developer use?

1) Scheduled messages
2) Dead-letter queues
3) Duplicate detection
4) Message sessions

Correct Answer: 1)

Explanation:

Azure Service Bus scheduled messages allow an application to specify a future time when a message should become available for processing. This is useful for scenarios such as delayed notifications, appointment reminders, subscription renewals, or retry workflows that should occur at a defined time. The sender schedules the message rather than requiring an external timer or application process to remain active until the delivery time. Dead-letter queues are intended for problematic messages, duplicate detection handles repeated submissions, and sessions group related messages for ordered processing. Scheduled delivery is therefore the most appropriate Service Bus capability for future message availability.

Q327. An Event Grid subscription should receive only events whose subject begins with /orders/europe. Which configuration should be used?

1) Event retry policy
2) Subject prefix filtering
3) Dead-letter destination
4) Consumer group

Correct Answer: 2)

Explanation:

Azure Event Grid supports subject-based filtering, including subject prefix and suffix filters. A subject prefix filter can be configured so that only events whose subject starts with a specified value, such as /orders/europe, are delivered to the subscription. This reduces unnecessary event processing and allows consumers to receive only events relevant to their application or business area. Retry policies control what happens when event delivery fails, while dead-letter destinations store events that cannot be delivered successfully. Consumer groups are associated with event streaming services such as Event Hubs rather than Event Grid subject filtering.

Q328. An Event Grid subscriber is temporarily unavailable, and events cannot be delivered successfully after the configured retry attempts. The team wants failed events stored for later analysis. What should be configured?

1) Subject filtering
2) Event subscription expiration
3) Consumer groups
4) A dead-letter destination

Correct Answer: 4)

Explanation:

An Event Grid dead-letter destination provides a place to store events that cannot be delivered successfully after Event Grid exhausts its retry behavior. This allows the application team to inspect failed events and potentially replay or otherwise process them later. Dead-lettering is especially useful when a subscriber is unavailable for an extended period or repeatedly returns delivery failures. Subject filtering is used to control which events reach a subscription, while consumer groups are not an Event Grid dead-lettering mechanism. Configuring a dead-letter destination improves reliability by preventing undeliverable events from simply being lost.

Q329. An application collects millions of telemetry events from devices and needs a highly scalable service for real-time event ingestion. Which Azure service is most appropriate?

1) Azure Event Hubs
2) Azure Blob Storage
3) Azure Key Vault
4) Azure App Configuration

Correct Answer: 1)

Explanation:

Azure Event Hubs is designed for high-throughput event ingestion and streaming scenarios. It can collect large volumes of telemetry, application logs, device events, and other streaming data for real-time or near-real-time processing. Event Hubs separates event producers from consumers and supports scalable ingestion through partitions. Consumers can process events using services such as Azure Functions, Stream Analytics, or custom applications. Blob Storage is primarily object storage, Key Vault manages secrets and cryptographic material, and App Configuration manages application settings. For millions of continuously generated telemetry events, Event Hubs is the most suitable option.

Q330. An Event Hubs application must distribute incoming events across multiple independent processing units to increase throughput. Which Event Hubs feature provides the logical data distribution mechanism?

1) Consumer groups
2) Access policies
3) Partitions
4) Capture

Correct Answer: 3)

Explanation:

Event Hubs partitions provide the fundamental mechanism for distributing event data within an event hub. Events are written to partitions, allowing multiple consumers to process different portions of the stream concurrently. Increasing the number of partitions can help support higher parallel processing capacity when the workload is designed appropriately. Consumer groups provide independent views of an event stream for different applications, while Capture automatically archives event data to storage. Access policies control authorization. Therefore, partitions are the feature directly responsible for organizing and distributing the event stream for scalable parallel processing.

Q331. Two independent applications need to read the same Event Hubs event stream without interfering with each other’s tracking of processed events. Which feature should be used?

1) Partitions
2) Consumer groups
3) Event Grid filters
4) Service Bus sessions

Correct Answer: 2)

Explanation:

Event Hubs consumer groups allow multiple independent consuming applications to read the same event stream while maintaining separate processing positions. Each consumer group maintains its own view of the stream, including offsets or checkpoints for consumed events. For example, one consumer group could process telemetry for analytics while another processes the same data for monitoring. Partitions organize the event stream, but they do not provide independent consumer tracking by themselves. Event Grid filters and Service Bus sessions are unrelated to independent Event Hubs consumption. Consumer groups are therefore the appropriate choice.

Q332. A company wants Event Hubs to automatically archive incoming events to Azure Blob Storage or Azure Data Lake Storage for later analysis. Which feature should be enabled?

1) Event Hubs Capture
2) Consumer groups
3) Partition keys
4) Service Bus forwarding

Correct Answer: 1)

Explanation:

Event Hubs Capture automatically captures streaming data from an event hub and writes it to Azure Blob Storage or Azure Data Lake Storage. This provides a convenient way to retain event data for batch processing, auditing, historical analysis, or downstream analytics without requiring a custom application to continuously read and store the events. Consumer groups control independent consumption, while partition keys influence how events are distributed across partitions. Service Bus forwarding belongs to Azure Service Bus messaging scenarios. Event Hubs Capture is therefore the most appropriate feature when automatic archival of streaming events is required.

Q333. An application frequently reads customer profile data that changes infrequently. The developer wants to reduce database load by storing frequently accessed data in Azure Cache for Redis. Which pattern should be implemented?

1) Retry pattern
2) Fan-out pattern
3) Cache-aside pattern
4) Publish-subscribe pattern

Correct Answer: 3)

Explanation:

The cache-aside pattern is commonly used with Azure Cache for Redis to reduce repeated database access. When an application needs data, it first checks Redis. If the data exists, the application returns the cached value. If it is missing, the application retrieves the data from the database, stores an appropriate copy in Redis, and then returns it. This approach reduces database load for frequently accessed information. The application remains responsible for deciding what should be cached and when cached values should expire or be refreshed. Retry, fan-out, and publish-subscribe patterns address different application requirements.

Q334. An application stores temporary customer session data in Azure Cache for Redis. The data should automatically disappear after 30 minutes if it is not refreshed. Which Redis capability should be configured?

1) Persistence snapshot
2) Key expiration time
3) Consumer group
4) Event Grid retry policy

Correct Answer: 2)

Explanation:

Azure Cache for Redis supports expiration times, also known as time-to-live values, for keys. Setting an expiration of 30 minutes causes Redis to automatically remove the key after that period unless the expiration is updated. This is useful for temporary session information, authentication-related state, cached results, and other data that should not remain indefinitely. Persistence snapshots serve a different purpose by helping retain data, while consumer groups are associated with event streaming and Event Grid retry policies control event delivery attempts. For temporary Redis data, configuring an appropriate key expiration time is the correct solution.

Q335. A developer wants to identify which SQL queries are consuming excessive CPU and review their historical performance in Azure SQL Database. Which feature should be used?

1) Azure SQL Query Store
2) Azure Storage lifecycle management
3) Service Bus sessions
4) Event Hubs Capture

Correct Answer: 1)

Explanation:

Azure SQL Query Store collects query performance and execution information over time, allowing developers and database administrators to analyze query behavior. It can help identify queries that consume significant CPU, examine execution statistics, compare performance over time, and investigate performance regressions. Query Store is especially useful when troubleshooting database performance because it provides historical query-related information rather than only showing the current workload. Storage lifecycle management manages blob data, Service Bus sessions organize related messages, and Event Hubs Capture archives streaming events. Therefore, Query Store is the appropriate feature for historical SQL query performance analysis.

Q336. A company hosts many databases with unpredictable workloads. It wants to share a common pool of compute resources across databases rather than provisioning dedicated resources for each database. Which Azure SQL feature should be considered?

1) Query Store
2) Point-in-time restore
3) Elastic pools
4) Private Endpoint

Correct Answer: 3)

Explanation:

Azure SQL Database elastic pools allow multiple databases to share a common set of compute and memory resources. They are particularly useful when databases have varying or unpredictable usage patterns because one database can use available capacity while another is less active. This can improve resource utilization and make costs more predictable compared with provisioning separate resources for every database. Query Store focuses on query performance analysis, point-in-time restore supports database recovery, and Private Endpoint provides private network connectivity. Elastic pools are therefore well suited to groups of databases with fluctuating workloads.

Q337. A developer accidentally deletes important rows from an Azure SQL Database. The database needs to be restored to a point shortly before the deletion. Which capability should be used?

1) Query Store
2) Point-in-time restore
3) Elastic pool
4) Read scale-out

Correct Answer: 2)

Explanation:

Azure SQL Database point-in-time restore allows a database to be restored to a selected time within the supported retention period. This capability is useful when data is accidentally deleted, corrupted, or otherwise changed and a previous database state is required. The restored database is typically created as a separate database, allowing the original database to remain available while recovery is evaluated. Query Store provides query performance information rather than database recovery. Elastic pools manage shared resources, while read scale-out supports read workloads. For recovering data from shortly before an accidental deletion, point-in-time restore is the appropriate choice.

Q338. An Azure SQL application occasionally experiences transient connection failures during short periods of service or network instability. What should the developer implement to improve application resilience?

1) Disable connection pooling
2) Replace SQL with Blob Storage
3) Implement transient fault retry logic
4) Remove database indexes

Correct Answer: 3)

Explanation:

Transient faults can occur because of temporary network problems, brief service interruptions, connection limits, or other short-lived conditions. Applications connecting to Azure SQL should use appropriate transient fault handling, including controlled retry logic with delays such as exponential backoff. The retry policy should avoid immediately sending a large number of repeated requests, which can increase pressure on the service. Connection pooling can also improve efficiency and should not generally be disabled merely because transient failures occur. Replacing SQL or removing indexes does not address temporary connectivity problems. Resilient retry handling is the appropriate application-level approach.

Q339. A development team wants to enable a new application feature for only a selected group of users without deploying separate application versions. Which Azure App Configuration capability should be used?

1) Feature flags
2) Blob versioning
3) Service Bus sessions
4) Event Hubs Capture

Correct Answer: 1)

Explanation:

Azure App Configuration feature flags allow developers to control application functionality through configuration rather than requiring a separate deployment for each feature state. Feature flags can be evaluated by the application and can support controlled rollout strategies, including enabling functionality for selected users or conditions when appropriate filters are configured. This makes gradual releases, testing, and feature management easier. Blob versioning protects previous versions of storage objects, Service Bus sessions support ordered message processing, and Event Hubs Capture archives event streams. Feature flags are therefore the correct App Configuration capability for controlled application feature rollout.

Q340. An application uses an Azure Key Vault certificate and secret. The team wants to prevent accidental permanent deletion and ensure deleted objects can be recovered during a retention period. Which Key Vault capabilities should be configured?

1) Consumer groups and partitions
2) Private Endpoint and CDN
3) Soft-delete and purge protection
4) Autoscale and deployment slots

Correct Answer: 3)

Explanation:

Azure Key Vault soft-delete and purge protection provide safeguards against accidental or unauthorized permanent deletion of vault objects such as secrets, keys, and certificates. Soft-delete allows deleted objects to remain recoverable during a retention period. Purge protection prevents those deleted objects from being permanently purged before the applicable retention period has elapsed. These capabilities are especially important for production environments where losing cryptographic material or application secrets could cause service disruption. Consumer groups, partitions, autoscale, deployment slots, and CDN features address unrelated Azure scenarios. Therefore, soft-delete combined with purge protection provides the required deletion protection.