You are developing a custom availability monitoring tool as a scheduled console application that runs on an Azure Virtual Machine (VM). The application monitors an internal HTTP service and uses the Azure Application Insights SDK to track availability using the `TrackAvailability()` method.
You write the following C# code to log the test results:
csharp
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
var configuration = TelemetryConfiguration.CreateDefault();
var telemetryClient = new TelemetryClient(configuration);
var availability = new AvailabilityTelemetry
{
Name = "InternalServiceCheck",
RunLocation = "AzureVM-EastUS",
Success = true
};
telemetryClient.TrackAvailability(availability);
telemetryClient.Flush();
During testing, you notice that availability metrics are not appearing in Application Insights. The connection string for Application Insights is stored in an Azure Key Vault secret.
Which two of the following configuration steps should you perform to resolve this issue and ensure the availability telemetry is securely sent to Application Insights? (Select two)
- Set the `ConnectionString` property of the `TelemetryConfiguration` object using the connection string value retrieved from Azure Key Vault.Answer
- Assign a system-assigned managed identity to the Azure Virtual Machine and grant it the Key Vault Secrets User role on the Key Vault containing the connection string.Answer
- CGenerate a Shared Access Signature (SAS) token for the Application Insights resource and assign it to the `TelemetryConfiguration` object to authorize telemetry ingestion.
- DUse the default `TelemetryConfiguration.Active` static configuration without specifying a connection string, as Azure VMs automatically route Application Insights traffic.