Enable Profiler for web apps on an Azure virtual machine
Note
We recommend that you use the Azure Az PowerShell module to interact with Azure. See Install Azure PowerShell to get started. To learn how to migrate to the Az PowerShell module, see Migrate Azure PowerShell from AzureRM to Az.
In this article, you learn how to run Application Insights Profiler on your Azure virtual machine (VM) or Azure virtual machine scale set via three different methods. Using any of these methods, you will:
- Configure the Azure Diagnostics extension to run Profiler.
- Install the Application Insights SDK onto a VM.
- Deploy your application.
- View Profiler traces via the Application Insights instance on Azure portal.
Pre-requisites
- A functioning ASP.NET Core application
- An Application Insights resource.
- Review the Azure Resource Manager templates for the Azure Diagnostics extension:
Add Application Insights SDK to your application
Open your ASP.NET core project in Visual Studio.
Select Project > Add Application Insights Telemetry.
Select Azure Application Insights, then click Next.
Select the subscription where your Application Insights resource lives, then click Next.
Select where to save connection string, then click Next.
Select Finish.
Note
For full instructions, including enabling Application Insights on your ASP.NET Core application without Visual Studio, see the Application Insights for ASP.NET Core applications.
Confirm the latest stable release of the Application Insights SDK
Go to Project > Manage NuGet Packages.
Select Microsoft.ApplicationInsights.AspNetCore.
In the side pane, select the latest version of the SDK from the dropdown.
Select Update.
Enable Profiler
You can enable Profiler by any of the following three ways:
- Within your ASP.NET Core application using an Azure Resource Manager template and Visual Studio (recommended).
- Using a PowerShell command via the Azure CLI.
- Using Azure Resource Explorer.
Install the Azure Diagnostics extension
Choose which Azure Resource Manager template to use:
In the template, locate the resource of type
extension
.In Visual Studio, navigate to the
arm.json
file in your ASP.NET Core application that was added when you installed the Application Insights SDK.Add the resource type
extension
from the template to thearm.json
file to set up a VM or virtual machine scale set with Azure Diagnostics.Within the
WadCfg
tag, add your Application Insights instrumentation key to theMyApplicationInsightsProfilerSink
.
"WadCfg": {
"SinksConfig": {
"Sink": [
{
"name": "MyApplicationInsightsProfilerSink",
"ApplicationInsightsProfiler": "YOUR_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY"
}
]
}
}
- Deploy your application.
Can Profiler run on on-premises servers?
Currently, Application Insights Profiler is not supported for on-premises servers.
Next steps
Learn how to...
Feedback
Submit and view feedback for