You are deploying a C# ASP.NET Core web application to an Azure App Service. In the Program.cs file, you register the telemetry services using builder.Services.AddApplicationInsightsTelemetry(). After deploying and running the application, you observe that no telemetry data is displayed in your Application Insights resource in the Azure portal. Which of the following configuration issues is the most likely cause of this behavior?
- The Application Insights connection string was not defined in the application settings or environment variables.Answer
- BThe Azure App Service was not granted GET permissions to the Key Vault containing the Application Insights resource credentials.
- CThe App Configuration store contains an invalid URI reference for the Application Insights endpoint.
- DThe App Service autoscale rules are misconfigured with conflicting scale-out and scale-in thresholds.
Answer
The Application Insights connection string was not defined in the application settings or environment variables.
The correct answer is correct because the Application Insights SDK needs to know where to send the collected telemetry. When builder.Services.AddApplicationInsightsTelemetry() is called, the SDK initializes. However, if the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable or configuration value is not set, no telemetry data will be sent to the Azure Monitor service.
Step-by-Step Solution
Key Concept
Application Insights SDK requires a valid Connection String to send telemetry data to the correct Azure resource.