Question:
A company uses Azure API Management to publish APIs for external consultants. The API needs to forward the user ID associated with the subscription key to the back-end service. Which type of policy should be used for this requirement?
Answer:
Forwarding the user ID that is associated with the subscription key to the back-end service would be done in an inbound policy.
<policies>
<inbound>
<set-header name="x-user-id" exists-action="override">
<value>@(context.Subscription.Id)</value>
</set-header>
</inbound>
</policies>