You are developing a secure Web API hosted in Azure App Service. The API requires mutual TLS (mTLS) client certificate authentication for all incoming requests. You need to configure availability monitoring for this API using Application Insights. The solution must verify that the API successfully authenticates clients using their client certificates. Which monitoring solution should you implement?
- AConfigure a Standard web test in Application Insights. In the request configuration, set the HTTPS URL of the API and add a custom header named X-Client-Cert containing the secret identifier of the client certificate stored in Azure Key Vault.
- BCreate an Azure Function app with a timer-triggered function. Retrieve the client certificate, perform the HTTPS request to the API, and instantiate a new TelemetryClient using the default parameterless constructor without setting the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable before calling TrackAvailability.
- Create an Azure Function app with a timer-triggered function. Configure the function to retrieve the client certificate from Azure Key Vault using a managed identity, perform the HTTPS request to the API with the certificate attached, and send the result using the TrackAvailability method of the TelemetryClient class.Cevap
- DCreate an Azure Function app with a timer-triggered function. Configure a system-assigned managed identity for the Function app, grant it the Monitoring Metrics Publisher role on the App Service, and write code to push availability metrics directly to Azure Monitor using the Azure Monitor REST API.
Cevap
Create an Azure Function app with a timer-triggered function. Configure the function to retrieve the client certificate from Azure Key Vault using a managed identity, perform the HTTPS request to the API with the certificate attached, and send the result using the TrackAvailability method of the TelemetryClient class.
To monitor an API requiring client certificate authentication, standard Application Insights web tests cannot be used because they do not support mutual TLS (mTLS) client certificate presentation. A custom availability test must be implemented. An Azure Function with a timer trigger can run on a schedule, securely retrieve the client certificate from Azure Key Vault using a managed identity, make the HTTPS call with the client certificate, and send the availability metrics using the TrackAvailability method of the TelemetryClient class.
Adım Adım Çözüm
Anahtar Kavram
Custom availability monitoring using TelemetryClient.TrackAvailability() for endpoints requiring client certificate authentication.