Courseiva

AZ-204 Practice Question: Monitor, troubleshoot, and optimize Azure solutions

You are a developer for a large e-commerce company. The company has a global customer base and runs a critical web application on Azure App Service (Premium v3 plan) deployed in multiple regions. The application uses Azure Cosmos DB (multi-region writes enabled) for product catalog and session state. Recently, the operations team reported that during peak shopping hours (e.g., Black Friday), the application becomes slow and some users experience timeouts. You have implemented Application Insights to collect telemetry. After analyzing the data, you find that the Cosmos DB write operations are experiencing high latency (average 200ms) and occasional throttling (429 errors). The read latency is acceptable. The App Service instances are scaled out to 20 instances during peak, and CPU usage is around 70%. You need to optimize the solution to reduce write latency and eliminate throttling without over-provisioning resources. The solution must be cost-effective and require minimal code changes. What should you do?

⚠ Common exam trap

Test-takers frequently confuse scaling the App Service (Option A) with scaling the database, or assume caching (Option B) can solve write latency, but writes must be persisted to Cosmos DB and caching does not help with throttling.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Enable autoscale on the Cosmos DB container with a maximum throughput limit

Enabling autoscale on the Cosmos DB container allows the throughput to automatically scale up to the maximum limit during peak traffic, eliminating throttling (429 errors) and reducing write latency without manual intervention. This approach is cost-effective as it scales down during low traffic, and requires minimal code changes since it's a configuration change at the Cosmos DB level.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Scale up the App Service plan to a higher tier to increase CPU capacity

    Why it's wrong here

    Scaling up the App Service plan to a higher tier would primarily increase the compute resources available to the application, such as CPU and memory. However, the problem statement indicates that the bottleneck is Cosmos DB, not the application's compute capacity, which is currently at 70% CPU utilization. Increasing App Service resources would not alleviate throttling errors originating from an under-provisioned Cosmos DB, as the application would still be waiting on the database. This action would incur unnecessary costs without resolving the core performance issue.

  • Implement Azure Cache for Redis to cache Cosmos DB read and write operations

    Why it's wrong here

    Implementing Azure Cache for Redis primarily benefits read-heavy workloads by reducing latency and offloading requests from the backend database. While it can significantly improve read performance, it does not directly address throttling issues caused by insufficient throughput for write operations in Cosmos DB. All write operations would still need to be persisted to Cosmos DB, consuming Request Units (RUs) and potentially leading to throttling if the provisioned throughput is inadequate for the write volume. Therefore, caching alone will not resolve write-related throttling.

  • Increase the provisioned RU/s manually before peak hours and decrease after

    Why it's wrong here

    Manually increasing and decreasing the provisioned Request Units per second (RU/s) for Cosmos DB requires significant operational overhead and careful monitoring to predict peak hours accurately. This approach is prone to human error, potentially leading to either over-provisioning and increased costs during off-peak times, or under-provisioning and continued throttling during unexpected spikes. Furthermore, the time taken to manually adjust throughput can introduce delays, making it an inefficient and less cost-effective solution compared to automated scaling mechanisms for dynamic workloads.

  • Enable autoscale on the Cosmos DB container with a maximum throughput limit

    Why this is correct

    Enabling autoscale on the Cosmos DB container is the most effective solution for dynamically managing throughput and preventing throttling errors. Autoscale automatically adjusts the provisioned Request Units per second (RU/s) based on the actual usage patterns of the workload, scaling up during peak demand and scaling down during lulls. Setting a maximum throughput limit ensures cost control by preventing the throughput from exceeding a predefined ceiling, while still allowing the system to adapt to varying loads and maintain application responsiveness without manual intervention.

About these practice questions

Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.