Step-by-step guide to set up Azure Application Insights for your Azure App Service
Azure Application Insights is a cloud-based service provided by Microsoft Azure that helps you monitor, diagnose, and improve the performance and availability of your web applications and services. It provides you with insights into your application’s usage, performance, availability, and user behavior, enabling you to identify and fix issues before they impact your customers.
Step 1: Create an Application Insights resource
- Log in to the Azure portal and select “Create a resource” from the left-hand menu.
- Search for “Application Insights” and select it from the list of services.
- Click on “Create” and fill out the required information for the resource, such as name, subscription, resource group, and location.
- Click on “Review + create” and then “Create” to create the resource.
Step 2: Enable Application Insights for your Azure App Service
- Go to the Azure App Service that you want to monitor with Application Insights.
- Click on “Application Insights” under the Monitoring section of the left-hand menu.
- Select the Application Insights resource that you created in Step 1 from the dropdown menu.
- Click on “Enable” to enable Application Insights for your App Service.
Step 3: Configure Application Insights
- Go back to your Application Insights resource in the Azure portal.
- Click on “Configure” in the left-hand menu.
- Select the “Application settings” tab.
- Scroll down to the “Instrumentation key” section and copy the value of the “Instrumentation Key”.
- Go back to your App Service in the Azure portal.
- Click on “Configuration” under the Settings section of the left-hand menu.
- Add a new setting with the name “APPINSIGHTS_INSTRUMENTATIONKEY” and paste the Instrumentation Key value you copied in Step 4 as the value.
- Click on “Save” to save the configuration changes.
Step 4: View Application Insights data
- Go to your Application Insights resource in the Azure portal.
- Click on “Overview” in the left-hand menu.
- Select the “Live Metrics Stream” tab to view real-time data about your App Service.
- Select the “Application Map” tab to see a high-level view of the components of your App Service.
- Select the “Performance” tab to view detailed information about the performance of your App Service.
That’s it! You’ve now set up Azure Application Insights for your Azure App Service.