You are designing a monitoring solution for a critical REST API hosted behind Azure API Management (APIM). The backend service dynamically adds a custom response header named `X-Backend-Server` to indicate which server instance processed the request. The monitoring solution must meet the following requirements:
1. Send an HTTP POST request to `https://api.contoso.com/health` with a JSON payload of `{"ping": true}` every 5 minutes.
2. Verify that the response status code is 200.
3. Verify that the response contains the `X-Backend-Server` header to ensure routing is functioning correctly.
4. Report the test duration, location, and success status as availability metrics to Application Insights.
You need to implement the availability monitoring solution. Which of the following should you do?
- Deploy an Azure Function integrated with your virtual network. In the function code, execute the HTTP POST request, verify the response status code and the `X-Backend-Server` header, and report the results using `TelemetryClient.TrackAvailability()` with an `AvailabilityTelemetry` object. Configure the function app to retrieve the Application Insights connection string from Azure Key Vault using a system-assigned managed identity granted the Key Vault Secrets User role.Cevap
- BConfigure a Standard availability test in Application Insights. To validate the response header, add a `<return-response>` policy to the `<inbound>` section of the API Management policy definition to copy the `X-Backend-Server` header value to the response body, and configure the test's Content Match success criteria to verify this value.
- CDeploy an Azure Function integrated with your virtual network to run the HTTP POST request and verify the response headers. In the function code, report the results using `TelemetryClient.TrackAvailability()`. Configure the function app to retrieve the Application Insights connection string from Azure Key Vault using a system-assigned managed identity, and grant the identity the Key Vault Contributor role on the Key Vault.
- DDeploy an Azure Function integrated with your virtual network to run the HTTP POST request and verify the response headers. In the function code, report the results by instantiating the `TelemetryClient` using the parameterless constructor `new TelemetryClient()` without configuring the `APPLICATIONINSIGHTS_CONNECTION_STRING` environment variable or passing any configuration objects to the client.