Question

Difficulty: EasyConfigure Application Insights Instrumentation and Telemetry

A developer is configuring a .NET Core Web API to use Azure Application Insights. In the Program.cs file, they add the call builder.Services.AddApplicationInsightsTelemetry(). However, they do not configure the Application Insights connection string in the appsettings.json file or in the App Service environment variables. What is the behavior of the application at runtime?

  1. A
    The application throws an unhandled exception at startup due to the missing connection string.
  2. B
    The application fails to initialize because it cannot access Key Vault due to a missing GET permission.
  3. The application starts and runs normally, but no telemetry is sent to Azure Monitor.Answer
  4. D
    The application startup is blocked because the hosting App Service autoscale rules have conflicting metric thresholds.

Answer

The application starts and runs normally, but no telemetry is sent to Azure Monitor.
The correct answer states that the application starts and runs normally, but no telemetry is sent to Azure Monitor. When the Application Insights SDK is registered in code but the connection string is missing or empty, the SDK initializes successfully but does not transmit any telemetry. It does not throw a startup exception, ensuring application availability is not compromised by a telemetry configuration omission.

Step-by-Step Solution

1
Determine the behavior of the Application Insights SDK when initialized without a connection string configuration.
The SDK initializes without throwing a runtime exception but remains in a dormant state.
This behavior prevents telemetry configuration omissions from causing application downtime in production environments.
2
Evaluate the distractors against Azure hosting and security behaviors.
Autoscale policies and Key Vault access issues do not block local SDK initialization directly.
This isolates the issue as a silent telemetry collection failure rather than a startup crash.

Key Concept

Application Insights SDK Initialization Behavior with Missing Configuration
Rate this question