Deploy Azure Monitor Application Insights Agent for on-premises servers
Application Insights Agent (formerly named Status Monitor V2) is a PowerShell module published to the PowerShell Gallery. It replaces Status Monitor. Telemetry is sent to the Azure portal, where you can monitor your app.
For a complete list of supported autoinstrumentation scenarios, see Supported environments, languages, and resource providers.
The module currently supports codeless instrumentation of ASP.NET and ASP.NET Core web apps hosted with IIS. Use an SDK to instrument Java and Node.js applications.
Application Insights Agent is located in the PowerShell Gallery.
- To get started with concise code samples, see the Getting started tab.
- For a deep dive on how to get started, see the Detailed instructions tab.
- For PowerShell API reference, see the API reference tab.
- For release note updates, see the Release notes tab.
This tab contains the quickstart commands that are expected to work for most environments. The instructions depend on PowerShell Gallery to distribute updates. These commands support the PowerShell
For an explanation of these commands, customization instructions, and information about troubleshooting, see the detailed instructions.
If you don't have an Azure subscription, create a free account before you begin.
Download and install via PowerShell Gallery
Use PowerShell Gallery for download and installation.
To enable monitoring, you must have a connection string. A connection string is displayed on the Overview pane of your Application Insights resource. For more information, see Connection strings.
As of April 2020, PowerShell Gallery has deprecated TLS 1.1 and 1.0.
For more prerequisites that you might need, see PowerShell Gallery TLS support.
Run PowerShell as an admin.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force Install-PackageProvider -Name NuGet -MinimumVersion 22.214.171.124 -Force Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted Install-Module -Name PowerShellGet -Force
Install Application Insights Agent
Run PowerShell as an admin.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force Install-Module -Name Az.ApplicationMonitor -AllowPrerelease -AcceptLicense
AllowPrerelease switch in the
Install-Module cmdlet allows installation of the beta release.
For more information, see Install-Module.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force Enable-ApplicationInsightsMonitoring -ConnectionString 'InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/'
Download and install manually (offline option)
You can also download and install manually.
Download the module
Manually download the latest version of the module from PowerShell Gallery.
Unzip and install Application Insights Agent
$pathToNupkg = "C:\Users\t\Desktop\Az.ApplicationMonitor.0.3.0-alpha.nupkg" $pathToZip = ([io.path]::ChangeExtension($pathToNupkg, "zip")) $pathToNupkg | rename-item -newname $pathToZip $pathInstalledModule = "$Env:ProgramFiles\WindowsPowerShell\Modules\Az.ApplicationMonitor" Expand-Archive -LiteralPath $pathToZip -DestinationPath $pathInstalledModule
Enable-ApplicationInsightsMonitoring -ConnectionString 'InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/'
Frequently asked questions
This section provides answers to common questions.
Does Application Insights Agent support proxy installations?
Yes. There are multiple ways to download Application Insights Agent:
- If your computer has internet access, you can onboard to the PowerShell Gallery by using
- You can also manually download the module and either install it on your computer or use it directly.
Each of these options is described in the detailed instructions.
Does Application Insights Agent support ASP.NET Core applications?
Yes. In Application Insights Agent 2.0.0 and later, ASP.NET Core applications hosted in IIS are supported.
How do I verify that the enablement succeeded?
You can use the Get-ApplicationInsightsMonitoringStatus cmdlet to verify that enablement succeeded.
Use Live Metrics to quickly determine if your app is sending telemetry.
You can also use Log Analytics to list all the cloud roles currently sending telemetry:
union * | summarize count() by cloud_RoleName, cloud_RoleInstance
How do I achieve proxy passthrough?
To achieve proxy passthrough, configure a machine-level proxy or an application-level proxy. See DefaultProxy.
<system.net> <defaultProxy> <proxy proxyaddress="http://xx.xx.xx.xx:yyyy" bypassonlocal="true"/> </defaultProxy> </system.net>
See the dedicated troubleshooting article.
Test connectivity between your application host and the ingestion service
Application Insights SDKs and agents send telemetry to get ingested as REST calls to our ingestion endpoints. You can test connectivity from your web server or application host machine to the ingestion service endpoints by using raw REST clients from PowerShell or curl commands. See Troubleshoot missing application telemetry in Azure Monitor Application Insights.
View your telemetry:
- Explore metrics to monitor performance and usage.
- Search events and logs to diagnose problems.
- Use Log Analytics for more advanced queries.
- Create dashboards.
Add more telemetry:
- Availability overview
- Add web client telemetry to see exceptions from webpage code and to enable trace calls.
- Add the Application Insights SDK to your code so that you can insert trace and log calls.
Do more with Application Insights Agent:
- Troubleshoot Application Insights Agent.