You are configuring telemetry for an ASP.NET Core web application deployed to Azure Container Apps using the .NET SDK. In your `Program.cs` file, you register the Application Insights services using the following code:
csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddApplicationInsightsTelemetry();
You configure the Container App with an environment variable named `APPINSIGHTS_INSTRUMENTATIONKEY` containing the valid instrumentation key of your Application Insights resource.
After deploying the application, you observe that no telemetry data is being received by Application Insights. There are no exception messages in the application logs, and the application is running successfully.
Which of the following modifications is required to resolve this issue and enable telemetry collection?
- Configure the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable in the Azure Container App instead of APPINSIGHTS_INSTRUMENTATIONKEY.Answer
- BAdd a Key Vault access policy to grant the Container App's system-assigned managed identity permissions to access the Application Insights resource.
- CModify the App Configuration reference to use the @Microsoft.KeyVault prefix to resolve the instrumentation key dynamically.
- DAdjust the container's autoscale rule metrics to resolve metric conflicts, which are currently blocking outbound telemetry traffic.