Azure API manangement ip-filter using a named value

Timo Holm 71 Reputation points
2022-01-26T16:55:56.06+00:00

Can I use Azure API management (APIM) named value in Inbound policy ip filter?

I have a configuration snippet

<policies>
<inbound>
<set-backend-service backend-id="mybackend" />
<ip-filter action="allow">
<address>{{ip1}}</address>
<address>{{ip2}}</address>
</ip-filter>

ip1 and ip2 are named values in APIM. When I try to provision this via Terraform, Terraform gives an error

{"code":"ValidationError","message":"Error in element 'address' on line 5, column 14: Cannot find a property 'ip1'","target":"address"} .

If I set ip:s direcly into address blocks, the policy works fine.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,722 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 67,986 Reputation points
    2022-01-27T07:04:50.027+00:00

    @Timo Holm You should define api_management_named_value before you are creating the policy. You should use depends_on for Explicit Dependencies. The same is define in the Note section here.