Friday 16 February 2018

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.
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.
Now at Operation level (GetProducts), lets define an rate limit policy to avoid excessive usage.
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.
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.
Lets implement a policy to store the response in a cache for a specific duration. Using get from cache and store cache as shown
 Lets test this operation and verify the behaviour from the trace.
As you can see, hit to back-end is avoided using cache store.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.