Is Named Values used in policy with Cache mechanism

Lily 116 Reputation points
2023-10-19T05:29:16.2033333+00:00

Hi, we want to know if Named Values used in policy with Cache mechanism. If so, how do we refresh its value ?

We want to update the code used in the policy which is configured in the Name Value.

The code snippet is like this

  <set-backend-service base-url="https://backendapi.azurewebsites.net/api" />
        <set-query-parameter name="code" exists-action="append">
            <value>{{API_code}}</value>
        </set-query-parameter>

The API_code is defined in the Name Value, Type=plain, pure value.
And the backend function app is with old_code and new_code simultaneously for testing.
The goal is to keep new_code only.

After we update API_code to the new_code and trigger API, we find APIM log is still using old_code in the URL to the backend.

The log is like this

Url
https://apim.azure-api.net/api/crm/contact_API?code=old_code

BackendUrl
https://backendapi.azurewebsites.net/api/contact_API?code=old_code&code=new_code

If we remove the old_code from the function app, this call will be failed with 401 Unauthorized error.

It seems the Named Value is with cache mechanism that we can't just update and read the update-to-date value.

Is there anything we can do on this to get the new_code value ?

Need your advise.

Thank you

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

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 13,345 Reputation points
    2023-10-19T06:01:04.4333333+00:00

    I have found the following hope it helps to you

    you can manually refresh the secret cache by using the API

    https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/named-value/refresh-secret?tabs=HTTP

    0 comments No comments