azure-api-managementpolicy

Azure APIM IP filter blocks developer portal


Applying an IP filter policy in APIM blocks requests from the developer portal. Is there a way to allow developer portal requests with IP filter policy?

Here is the policy I used in the inbound section. The second IP is the Virtual IP (VIP) address of the Gateway, which is the same when running nslookup of developer portal URL.

<ip-filter action="allow">
        <address>13.**.**.72</address>
        <address>20.2**.***.158</address>
    </ip-filter>

Here is the screenshot of response when testing the API from Developer portal.enter image description here


Solution

  • Is there a way to allow developer portal requests with IP filter policy?

    In order to send the requests with ip-filter policy from Developer Portal, add X-Forwarded-For IP in the policy.

    <ip-filter action="allow">
        <address>x-Forwarded-For IP</address>
    </ip-filter>
    

    You can get the value of X-Forwarded-For in the trace of any success response.

    enter image description here

    After adding it in my policy, I am getting successful result.

    enter image description here