In our previous post, we showed how to setup and use API Management (APIM) in the Microsoft Azure Portal. Now that APIM is set up, let’s add Application Insights to monitor the usage of these APIs.
Application Insights, or App Insights, or an Azure service that can be used to provide detailed monitoring and reporting of your application. Let’s set it up with our test APIM app.
Log into https://portal.azure.com/ and search for Application Insights:
Enter a resource group, name and region and click Review + Create:
And then Create:
You will see Your Deployment is Underway:
And then Complete:
Now let’s link it to our APIM. Open the APIM in Azure and from the left menu select Application Insights:
Select the App Insights we just created from the list and click Create:
Now browse out to the API by selecting APIs. We will select our Demo Conference API. Click on the Settings tab and scroll down to Diagnostic Logs. From here, check Enable, then select the App Insights we created. Set the Sampling to 100 and check Always log errors. Click Save:
Now let’s send a request and watch it be logged by our App Insights. Go to the Test tab and click GetSessions, then Send:
This returns a list of Sessions:
Now, on our App Insights, we server requests coming through:
Click on the Live Metrics Stream:
Before sending a request, you will see the Incoming Requests as blank:
On sending the same GetSessions request, we see it come in:
App Insights has more capabilities that we will go into in later posts.