Question

Difficulty: MediumConfigure Application Insights Web Tests and Availability Monitoring

Your company is developing a custom availability monitoring solution for an internal microservice that is not accessible from the public internet. You create an Azure Function App with a Timer trigger configured to run every 5 minutes. The function must execute a health check against the microservice and send the availability results to Application Insights so that they appear in the Availability dashboard.

You need to implement the monitoring solution.

Which two actions should you perform? Select two.

  1. Instantiate a TelemetryClient and invoke the TrackAvailability method passing an AvailabilityTelemetry instance.Answer
  2. Add the APPLICATIONINSIGHTS_CONNECTION_STRING setting to the Function App's configuration settings.Answer
  3. C
    Use the TelemetryConfiguration.Active singleton to configure the telemetry pipeline with a hardcoded instrumentation key.
  4. D
    Add a Key Vault reference for the connection string in the Function App settings without granting the Function App's managed identity GET permissions in Key Vault.

Answer

To implement custom availability monitoring, you should instantiate a TelemetryClient and invoke the TrackAvailability method passing an AvailabilityTelemetry instance, and configure the APPLICATIONINSIGHTS_CONNECTION_STRING setting in the Function App's configuration settings.
The correct solution involves two main steps: first, utilizing the specialized SDK method for availability telemetry, which is TrackAvailability with an AvailabilityTelemetry object, to ensure the data is parsed correctly by the Application Insights dashboard. Second, configuring the APPLICATIONINSIGHTS_CONNECTION_STRING application setting in the Function App ensures that the SDK can connect and upload telemetry to Azure Monitor.

Step-by-Step Solution

1
Select the correct SDK method for reporting availability.
Identify that the TrackAvailability method must be called to send availability telemetry that populates the Availability tab in Application Insights.
Other telemetry methods like TrackEvent or TrackMetric do not register as availability tests in the portal dashboard.
2
Configure the connectivity to the Application Insights resource.
Define the APPLICATIONINSIGHTS_CONNECTION_STRING configuration setting in the Azure Function App settings.
The Application Insights SDK relies on the connection string to authenticate and send telemetry to the correct endpoint.

Key Concept

Custom availability monitoring in Application Insights using TrackAvailability and Azure Functions requires proper initialization of the SDK using the Application Insights connection string.
Rate this question