APIM cache-lookup-value with external Redis - Key is always prefixed by '2_'

Julien 6 Reputation points
2022-05-17T22:42:23.717+00:00

I am trying to access an existing Azure Cache for Redis instance from a GET operation on APIM.

The cache content looks like this:
202917-image.png

This is the policy I use to access the data:
202840-image.png

When I test it on APIM, the Trace window shows this:
202897-image.png

The prefix "2_" is actually the piece that causes an issue for me right now, as I am unable to use my Redis instance. It seems it is dynamically added by APIM.
So far, I was unable to find any official documentation that explains this behavior.

Does anyone have any idea about anything related to this topic ?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,953 questions
Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
232 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 19,646 Reputation points Microsoft Employee
    2022-05-20T04:47:27.813+00:00

    @Julien Thanks for reaching out. I have checked with APIM team internally on this they have said that the format of Redis cache key and its name are not documented, and you should not relied upon it. At the moment it is prefixed to achieve better reliability and cache performance when internal cache implementation changes and effectively denotes format of the data.

    If you need to manipulate cache context of active API calls consider creating a new API in APIM that you would use to manipulate cache content and use existing caching policies to do so.

    Feel free to reach back to me if you have any further queries on this.

    0 comments No comments