An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Thank you for reaching out to Microsoft Q&A.
In Azure API Management, requests are logged to Application Insights only after they successfully enter and progress through specific stages of the APIM request pipeline. Even if Application Insights diagnostics are configured identically at the API level, a request may not appear in Application Insights if it is rejected, short‑circuited, or blocked before APIM emits telemetry. In your scenario, API B is logged because the request reaches the frontend/backend pipeline and completes processing, whereas API A is not logged because the request is likely being stopped earlier in the inbound pipeline or never fully processed by APIM in the TEST environment. This can happen due to inbound policies, operation‑level overrides, request validation failures, or environment‑specific differences, even though the same API works as expected in PROD.
Refer below points to resolve this issue or as a workaround:
1. Check inbound policies for API A (TEST) Review the <inbound> policies applied at the API and operation level. Policies such as validate-jwt, check-header, rate-limit, ip-filter, or return-response can terminate the request before telemetry is sent to Application Insights. Compare the inbound policies between TEST and PROD carefully, including named values and secrets.
2. Verify operation-level diagnostics configuration Even if API-level diagnostics look identical, an individual operation under API A may have diagnostics disabled or different verbosity. Operation-level diagnostics override API-level settings, so ensure logging to Application Insights is enabled for the specific operation being called.
3. Confirm the request actually reaches the APIM pipeline If the request is blocked due to TLS/SNI issues, WAF, Front Door, firewall rules, VNet/NSG configuration, or incorrect host headers, APIM will not process the request and no Application Insights log will be generated. Validate that the request reaches APIM successfully in TEST.
4. Add a temporary trace policy to validate pipeline execution As a diagnostic step, add the following at the top of the inbound policy for API A:
<trace severity="information">
<message>Inbound pipeline reached</message>
</
Then check Application Insights traces. If this trace does not appear, the request is not reaching the APIM pipeline stage where telemetry is emitted.
5. Check sampling settings in Application Insights Ensure sampling is set to 100% (or disabled) for APIM telemetry in TEST. Adaptive or fixed sampling may drop some requests, which can make it appear as if certain APIs are not being logged.
If the resolution was helpful, kindly take a moment to click on
and click on Yes for was this answer helpful. And, if you have any further query do let us know.