Using Advanced Policies
The APIM policy is a powerful tool for managing many aspects of APIM communication. You can manage caching, header authentication, IP filtering, rewriting URLs, returning policies, converting output into a different format, and much more. A policy in APIM is provided as an XML configuration applied for the operation it is specified for. You can also set up a global policy for APIs and refer to the global policy from the operation’s policy, just as, in code, an inherited class can call the base class. This approach allows you to minimize duplication in policies and follow the Don’t Repeat Yourself (DRY) principle.
Global and operation policies come with the same XML syntax and consist of four sections: <inbound>
, <backend>
, <outbound>
, and <on-error>
. Each of the sections can be extended with custom code. The global policy for APIs can be referenced from the operation’s policy by including the <base/>
tag...