Get started with Azure Monitor Application Insights Agent for on-premises servers
This article contains the quickstart commands expected to work for most environments.
The instructions depend on the PowerShell Gallery to distribute updates.
These commands support the PowerShell -Proxy parameter.
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
Install prerequisites
- To enable monitoring you will require a connection string. A connection string is displayed on the Overview blade of your Application Insights resource. For more information, see page Connection Strings.
Note
As of April 2020, PowerShell Gallery has deprecated TLS 1.1 and 1.0.
For additional prerequisites that you might need, see PowerShell Gallery TLS Support.
Run PowerShell as Admin.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
Install-Module -Name PowerShellGet -Force
Close PowerShell.
Install Application Insights Agent
Run PowerShell as Admin.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
Install-Module -Name Az.ApplicationMonitor -AllowPrerelease -AcceptLicense
Note
AllowPrerelease switch in Install-Module cmdlet allows installation of beta release.
For additional information, see Install-Module.
Enable monitoring
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)
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 monitoring
Enable-ApplicationInsightsMonitoring -ConnectionString 'InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/'
Next steps
View your telemetry:
- Explore metrics to monitor performance and usage.
- Search events and logs to diagnose problems.
- Use Analytics for more advanced queries.
- Create dashboards.
Add more telemetry:
- Create web tests to make sure your site stays live.
- Add web client telemetry to see exceptions from web page code and to enable trace calls.
- Add the Application Insights SDK to your code so you can insert trace and log calls.
Do more with Application Insights Agent:
- Review the detailed instructions for an explanation of the commands found here.
- Use our guide to troubleshoot Application Insights Agent.
Povratne informacije
Pošalјite i prikažite povratne informacije za