@Martin Kallukalam Thanks for reaching out. In APIM, the subscription key authentication is evaluated before the inbound policies are applied. This means that if the subscription key is missing or invalid, the request will be rejected with a 401 Unauthorized
response before any inbound policies are executed.
Given this, the approach of encoding the subid:subkey
and decoding it in the inbound policy won't work as intended.
Instead, you might consider using a different authentication mechanism that allows for custom handling, such as OAuth 2.0 or JWT tokens, which can be processed within the inbound policies.
https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions
do let me know incase of further queries, I would be happy to assist you.