DEV Community

Daniel Jonathan
Daniel Jonathan

Posted on • Originally published at biztalkdj.blogspot.com on

Azure API Management | Azure APIM Policies | APIM-Basics

In the previous article, I briefed about on-boarding API to Azure APIM. Now lets see how to configure policies at various levels. Policies can be configured at product , API or at Operation level.

1

Policies are inherited from top to bottom, here we configured authenticate policy at the API level thus this would be applied to all operation available in the API.

1

Now at Operation level (GetProducts), lets define an rate limit policy to avoid excessive usage.

1

Lets test the API, through PostMan tool/Developer portal. As seen, http basic authentication header is set at the API level and forward to the backend url i.e, actual service.

1
Lets trigger the request multiple times within the time-frame. And rate-limit policy avoid the processing the request to back-end and hence unnecessary load is avoided.

1

Lets implement a policy to store the response in a cache for a specific duration. Using get from cache and store cache as shown

1

Lets test this operation and verify the behaviour from the trace.

1

As you can see, hit to back-end is avoided using cache store.

Top comments (0)