Adding App Insights to an Azure App Service

Leave a comment

In this post, we will look at how to add Azure App Insights into an App Service.

Log into the Azure portal at https://portal.azure.com/ and select your App Service, then go to the Application Insights menu option. Click Turn on Application Insights:

We see “Your app will be connected to an auto-created Application Insights resource: CarlCRMAPI
Instrumentation key will be added to App Settings. This will overwrite any instrumentation key value in web app configuration files.” Enter a resource name and scroll down before hitting apply:

We can set a few other settings here. Let’s click Apply with the defaults:

We see “This will restart the site. Do you want to continue?”. Click Yes:

App Insights should now be set up. We get a link to View Application Insights data. Let’s click it:

This takes us to the App Insights that we created. Note we have an Instrumentation Key, Connection String and some metrics on the Overview tab, including Failed Requests, Server Response Time, Server Requests and Availability:

Let’s create a Postman request to call our API. We get a response back. Let’s run this a few times:

Now in App Insights, we can see the requests coming through:

And clicking on the Performance tab shows us more details on the requests:

Let’s send through a request that will fail, e.g. by adding “1” to the API:

We see the new request coming through:

And it shows in the failed requests:

Finally, if you have an APIM in front of your API, and you hit the APIM, e.g. through Postman, those requests will also show up in App Insights for the API:

That’s it, we now have App Insights running for this API.

 

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

Your email address will not be published. Required fields are marked *