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.
- Instantiate a TelemetryClient and invoke the TrackAvailability method passing an AvailabilityTelemetry instance.Cevap
- Add the APPLICATIONINSIGHTS_CONNECTION_STRING setting to the Function App's configuration settings.Cevap
- CUse the TelemetryConfiguration.Active singleton to configure the telemetry pipeline with a hardcoded instrumentation key.
- DAdd 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.
Cevap
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.
Adım Adım Çözüm
Anahtar Kavram
Custom availability monitoring in Application Insights using TrackAvailability and Azure Functions requires proper initialization of the SDK using the Application Insights connection string.