API Management Services no longer logs query parameters set via inbound policies

Christopher Watford 1 Reputation point
2024-10-01T15:00:08.5733333+00:00

Previously we used an stv1/standard APIM instance which had the following policy set on all APIs:

<policies>
  <inbound>
    <base />
    <set-query-parameter name="x-query-param" exists-action="override">
      <value>@(context.Request.Headers.GetValueOrDefault("x-header-name"))</value>
    </set-query-parameter>
...

When viewing logs within our Log Analytics workspace the BackendUrl property would contain this parameter tacked onto the end.

We recently created a brand new stv2/standard APIM instance with the SAME policy set. We now no longer receive x-query-param as a query parameter on the BackendUrl property as we would expect.

Why does this no longer work? Has there been a change to how policies function with an stv2/Standard instance?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,446 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 29,261 Reputation points
    2024-10-11T03:51:57.9033333+00:00

    @Christopher Watford Thanks for your patience. The diagnostic settings in APIM do have special parameters like Data Masking that control how query parameters are logged.

    You can mask or hide sensitive query parameters and headers in diagnostic logs. The hide setting will remove an entity, while mask setting will replace it with the word "hidden". Refer to the API endpoint documentation for more details.

    do verify and let me know incase of further queries, I would be happy to assist you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.