Courseiva
Develop Azure compute solutionsmediumMultiple ChoiceObjective-mapped

AZ-204 Develop Azure compute solutions Practice Question

You deploy an Azure Function app that runs on the Consumption plan. The function writes logs to Application Insights. You notice that some log entries are missing during periods of high load. You need to ensure that all logs are captured without significantly increasing cost. What should you do?

⚠ Common exam trap

A common mix-up: candidates think disabling sampling in host.json or upgrading the plan will fix missing logs, but they overlook that Application Insights sampling is controlled at the Application Insights configuration level, not the function app's host configuration.

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

Adjust the sampling rate in the Application Insights configuration to 100%.

Under high load, Application Insights uses adaptive sampling by default to reduce data volume, which can cause log entries to be dropped. Adjusting the sampling rate to 100% in the Application Insights configuration ensures all telemetry data is captured, while still running on the Consumption plan, which does not significantly increase cost because the function app itself scales and you only pay for execution time and resources used.

Answer analysis

Option-by-option breakdown

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

  • Adjust the sampling rate in the Application Insights configuration to 100%.

    Why this is correct

    Adjusting the Application Insights sampling rate to 100% directly addresses missing telemetry by ensuring that all generated data, including logs, requests, and dependencies, is sent from the function app to the Application Insights resource. By default, Application Insights SDKs often employ adaptive sampling to reduce data volume and associated costs, which can lead to certain telemetry items being discarded. Setting the sampling rate to 100% overrides this behavior, guaranteeing maximum data capture, though it may increase ingestion costs if the telemetry volume is high.

  • Change the function app to the Premium plan to get more CPU and memory.

    Why it's wrong here

    Changing the function app to a Premium plan primarily provides dedicated compute resources, enhanced networking capabilities, and longer execution timeouts, but it does not inherently resolve issues with missing Application Insights telemetry. The Premium plan addresses performance and scalability concerns for the function app itself, not the configuration or behavior of the Application Insights SDK responsible for collecting and transmitting logs. Missing logs are typically a telemetry configuration issue, not a compute resource constraint.

  • Create a separate Application Insights resource for the function app.

    Why it's wrong here

    Creating a separate Application Insights resource for the function app does not resolve the problem of missing logs because it merely provides a new destination for telemetry data. The core issue of why logs are not being captured or are being discarded (e.g., due to sampling) remains unaddressed. Each Application Insights resource operates independently, but the telemetry collection logic, including sampling, is configured at the source (the function app's SDK), not by the destination resource itself.

  • Disable sampling in the function's host.json.

    Why it's wrong here

    Disabling sampling solely within the function's host.json file is often insufficient to guarantee that all telemetry is sent to Application Insights. While host.json controls host-level logging and sampling for certain types of data, the Application Insights SDK itself implements its own client-side sampling mechanisms, such as adaptive sampling, which dynamically adjusts the telemetry volume. Therefore, even with host.json sampling disabled, the Application Insights SDK might still discard data, or the ingestion endpoint could apply ingestion sampling if the volume is excessive, leading to continued missing logs.

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.