Microsoft Azure Developer Associate AZ-204 Practice Question

An ASP.NET Core Web API deployed to Azure App Service has the Microsoft.ApplicationInsights.AspNetCore SDK installed. You need to record a custom event named "FileProcessed" from inside a controller action and ensure that the event is automatically correlated with the incoming request telemetry (that is, it carries the same operation-id and parent-id).

Which implementation meets the requirement?

  • Retrieve RequestTelemetry from HttpContext.Features and add a property named "FileProcessed" to it.

  • Add a TelemetryClient parameter to the controller constructor, store it in a field, and call _telemetryClient.TrackEvent("FileProcessed"); inside the action.

  • Inside the action create a new instance: var tc = new TelemetryClient(); tc.TrackEvent("FileProcessed");

  • Call ILogger.LogInformation("FileProcessed"); because the logging provider forwards log messages as custom events.

Microsoft Azure Developer Associate AZ-204
Monitor and troubleshoot Azure solutions
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot