Setting Up Azure Application Insights | Configuring in .NET Core Web API | Step-by-Step Guide | LSC

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign the ultimate destination for mastering Cutting Edge Tech skills from front-end framework to the backend system our video covers it all with real-time demos and in-depth tutorials we will teach you how to code like a pro subscribe now and start your journey to becoming a smart coder have you ever struggled with debugging your Dot and core applications in this video I'll show you a simple solution to ensure your app runs smoothly and efficiently using App insights stick around until the end to learn how you can easily configure this powerful tool for your own projects so I have already deployed my web application in the Azure app service and this is what it is and if I open this if I go to the swaggery world you know it will open up but there is no logs recorded right so so you don't have any idea how to do it so there is something called application insights so if you have not configured this when you build an app service it's okay you can come here click on it and you know select the defaults and it's gonna uh you know allow you to create an application insights for this website okay and then the name also will be similar to the website name you can do this apply this and then you know it gets deployed and once it is ready you can click on go to Resource and if you go to the resource this is what uh the application insights will look so it will give you the name of the application insights it will give you the instrumentation key and others other things you can also go to the application insights by the search panel and you can create from here when you do it from here you can name whatever you wanted to name but ideally they create for each environment in organization okay so now let's focus on only one uh part let's assume only for production purpose okay so once you've done this if you go here you can see uh the instrumentation key over here on the overview blade and there's something called connections thing also okay so only those two are important thing now come back to the application under the development.json you will have a configuration call application insights and Nano connections thing just copy paste the connection string and this instrumentation key you can copy the instrumentation key and you can place it here either you use application insights or the instrumentation key I mean the connection string or the instrumentation key only one is sufficient I'm just giving you uh the reason why I'm using connection stringers if I run this application from my local since the connection string is present it will run it and then you need to install this package application search dot asp.net core package and so two tabs and then the last final step is come to the application main program and using the build.service just add the add application system metric that's it only three piece of code that you need in order for you to do this and I'm gonna publish this and show you how this looks okay it's getting published and you can see you know the timelines uh we're gonna show the couple of endpoints we're gonna kick in and then I'll show you how it looks so let's run this quickly it's gonna hit this end point and then I'm gonna just you know randomly hitting couple of endpoints just to generate the locks okay because it's now tied up to the connection string so because we deployed it anything that you do on this website gets recorded here so it's take uh you know a little time to uh you know get this locks here let's wait for a few more seconds and uh so this is one part that I was mentioning let's copy paste in the production Json because when we deployed the production is what will run so we forgot it that's why it was not working now we have it in the production configuration also and now if I just run couple of requests and if I go here see I can start seeing this so basically the development is to run it from the local and the production is for the after deployment ideally in Organization for each environment there will be a different app inside so that every environment locks their own stuff in the specific application insights okay so you can drill down by going inside each of the log you can click on the samples you can go to specific sample you can get to see the 200 the different error messages you know lot of things and once you have configured this you have a lot of other features in the application insights itself to your left side you can see um you know all the settings and other stuff you can see the right side based on what you choose you can you can perform the exceptions you can read what kind of exceptions the detailed calls track everything is visible right so this will give us an idea of uh what went wrong for a particular request and then you know you can set up some alerts if something goes wrong right so all those things you can do so each and every single calls will get recorded here and you can see your response time of the apis and other stuff so let me run this from the local and this time I'm going to hit the different endpoints okay just to prove you that even when you run it from your local this is gonna work okay so that's our idea so from our local I'm running I'm running at different endpoints so if I come here the endpoints which I ran I know that will fail that's okay because if you can go to the failure State and you can see see as your storage download blocks which failed which is expected to fail and you can see click on the 500 error you can go to the sample you can see the complete stack Trace so all these informations are recorded nicely it will help you to speed up to find out what went wrong all those stuff and what else you can do is uh basically you can see all these things now right now we are logging into the same app inside so whether you deployed or you're running from local everything show up on the same page but uh as I said there will be different different app insights now you can go to your website select some you know alerts if there is an error you know send me an email put the lock to some place all those things you can do it so under monitoring you have different options alerts logs diagnostics test settings uh you know all those things have already covered in different videos so feel free to go and explore it but this video is mainly to set up the app insights in the uh as your app service and how to debug from your local as well as after you deploy how to look into it so those are the details of this video I hope you enjoyed this video thanks for watching if you found this video helpful please give it a thumbs up and subscribe to our channel for more Tech tutorials and don't forget to hit the Bell icon to get notified when we post new videos if you have any questions or suggestions leave them in the comments below happy coding
Info
Channel: Learn Smart Coding
Views: 3,240
Rating: undefined out of 5
Keywords: Azure Application Insights, Azure Portal Setup, .NET Core Web API Configuration, Monitoring and Logging, Performance Monitoring, Application Performance, Azure Monitor, Log Analytics, Diagnostic Logs, Application Metrics, Exception Tracking, Error Logging, Step-by-Step Guide
Id: SmcYJLqBJ7U
Channel Id: undefined
Length: 6min 35sec (395 seconds)
Published: Mon May 22 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.