Azure API Management: PowerShell Reporting & Cache Hit Ratio

I was recently working with a customer who needed to view the cache hit ratio of an Azure API Management instance. Currently the UI dashboard doesn’t report this information, however there is a lovely API which you can call.

As we needed something up and running fast PowerShell seemed like the perfect way to quickly retrieve the JSON and convert it into an object then format it nicely. The script also stores the results to disk so we have a copy to hand.

Output

Here is the resulting little script.

[gist https://gist.github.com/lawrencegripper/c92c245f20050381b7dd]

To use this on your instance replace the URL and SharedSigniture with your own. You can get these from the administration portal for APIM under the security tab.

For full details on what you can do with the rest API head here for the docs. https://msdn.microsoft.com/en-us/library/azure/dn776326.aspx

Tagged , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: