Author : MD TAREQ HASSAN | Updated : 2020/11/26
What is Application Insights?
- Azure Application Insights is a service provided by Microsoft that helps you improve the performance and usability of your live application
- A feature of Azure Monitor, is an extensible Application Performance Management (APM) service for developers and DevOps professionals
- Application Insights monitors the availability, performance, and usage of your web applications whether they’re hosted in the cloud or on-premises
- In Azure cloud: Application Insights can be used as a service
- On-premise: Need to use SDK and your app will send metrics to Application Insights hosted in Azure
- Application Insights creates charts and tables that show you, for example, what times of day you get most users, how responsive the app is, and how well it is served by any external services that it depends on
- The Application Insights service stores and analyzes the telemetry
- Details: https://docs.microsoft.com/en-us/azure/azure-monitor/app/data-retention-privacy
Sources of data collected by Application Insights
There are three sources of data:
- SDK: integrate with your app either in development or at run time
- Web servers: there are also agents that run alongside the app and send telemetry about CPU, memory, and network occupancy. For example, Azure VMs, Docker hosts etc.
- Availability tests are processes run by Microsoft that send requests to your web app at regular intervals. The results are sent to the Application Insights service
Creating Application Insights Using Azure Portal
Create Resource Group:
- Go to: https://portal.azure.com/#create/Microsoft.ResourceGroup (login to Azure portal first, then click the link)
- Fillup details (i.e. name ‘
demo-rg
’, select subscription etc.) - Create
Create Application Insights
- Go to: https://portal.azure.com/#create/Microsoft.AppInsights
- Fillup details > Create and review
- Create
Creating Application Insights using PowerShell
# Create resource group
New-AzResourceGroup -Name "demo-rg" -Location "Japan East"
# Create application insights
# Command:
# New-AzApplicationInsights
# [-ResourceGroupName] <String>
# [-Name] <String>
# [-Location] <String>
# [-Kind <String>]
# [-Tag <Hashtable>] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
# Kind (one of these ->): web, ios, other, store, java, phone
New-AzApplicationInsights -ResourceGroup "demo-rg" -Name "demo-applicationinsights" -Location "Japan East" -Kind "web"