Microsoft Azure Developer Associate AZ-204 Practice Question
An ASP.NET Core web API is hosted on Azure App Service. You enabled Application Insights from the portal so the service is auto-instrumented without code changes. The operations team asks you to record a custom event named "OrderShipped" each time an order is finalized. You must minimize deployment pipeline changes while ensuring the event is captured. Which approach should you use?
Configure the App Service diagnostic logs to forward to a Log Analytics workspace instead of Application Insights.
Rely only on the existing auto-instrumentation and expect the custom event to appear automatically.
Add the Microsoft.ApplicationInsights.AspNetCore SDK to the project and call TelemetryClient.TrackEvent("OrderShipped") inside the order-completion logic.
Redeploy the code as an Azure Functions app with the APPINSIGHTS_INSTRUMENTATIONKEY setting configured.
Auto-instrumentation enabled from the Azure portal collects standard telemetry such as requests, dependencies, exceptions, and performance counters, but it cannot emit new, application-specific events. To send a custom event like "OrderShipped" you must reference the Application Insights SDK package in the project, obtain an instance of TelemetryClient, and call TrackEvent (or another Track* method). Adding the SDK is considered manual instrumentation, even though the resource was originally set up with codeless attach. Merely relying on the portal-based auto-instrumentation, moving the app to Azure Functions, or exporting logs to Log Analytics would not provide a mechanism to call TrackEvent, so those options would fail to meet the requirement.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is auto-instrumentation in Azure Application Insights?
Open an interactive chat with Bash
What is the role of TelemetryClient in Application Insights?
Open an interactive chat with Bash
What is the difference between codeless and manual instrumentation in Application Insights?
Open an interactive chat with Bash
Microsoft Azure Developer Associate AZ-204
Monitor and troubleshoot Azure solutions
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .