Integrate Application Insights to the Azure Web App
This project uses the project we created earlier as a foundation. In this project, we’ll integrate Application Insights to the Azure Web App. A prerequisite for this project is to first create all the resources we created previously, and then, work on integrating Application Insights.
The project is about creating a Log Analytics workspace and an Application Insights resource and then using their connection string in our web application. The project is divided into subtasks, and we’ll complete them step by step.
Creating previous resources: We’ll create a storage account and create a container inside it. Then, we’ll upload a BACPAC file to the container. After that, we’ll create an SQL database and import the data using the same BACPAC file.
Creating a Log Analytics workspace: We’ll create a Log Analytics workspace because we have to use it for creating an Application Insights resource.
Setting up an Application Insights resource: We’ll also create an Application Insights resource that we’ll use to generate metrics for our web application. We’ll copy its instrumentation key and use it in our application.
Updating the code: Once we’ve created the necessary resources, we’ll make the necessary code changes. We can view the metrics of the web app once we start hitting requests on it.
Note: Upon correct execution of all of the above steps, we’ll see something like this: