Reusing APIM policy expressions

拟墨画扇 提交于 2019-12-02 07:47:06

If you're looking to define a policy once in an instance of APIM, and have it be present across all of that instance's APIs, you want to define a base policy. When you look at a policy page of a newly created API, it will look like this:

<policies>
    <inbound>
        <base />
    </inbound>
    <backend>
        <base />
    </backend>
    <outbound>
        <base />
    </outbound>
    <on-error>
        <base />
    </on-error>
</policies>

<base /> refers to whatever inbound/backend/outbound/on-error policies are defined for All APIs. To get to that policy document, see the image below

The policies you define there are imported by the <base /> tag in all your APIs.

Using Named Values may also facilitate code reuse.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!