In this article, you learn how to run Application Insights Profiler for .NET on your Azure virtual machine (VM) or Azure virtual machine scale set via three different methods:
Visual Studio and Azure Resource Manager
PowerShell
Azure Resource Explorer
Select your preferred method tab to:
In this guide, you learn how to:
Configure the Azure Diagnostics extension to run the .NET Profiler.
Install the Application Insights SDK on a VM.
Deploy your application.
View Profiler traces via the Application Insights instance in the Azure portal.
Set-AzVMDiagnosticsExtension might require the -StorageAccountName argument. If your original diagnostics configuration had the storageAccountName property in the protectedSettings section (which isn't downloadable), be sure to pass the same original value you had in this cmdlet call.
IIS Http Tracing feature
If the intended application is running through IIS, enable the IIS Http Tracing Windows feature:
Establish remote access to the environment.
Use the Add Windows features window, or run the following command in PowerShell (as administrator):
If establishing remote access is a problem, you can use the Azure CLI to run the following command:
az vm run-command invoke -g MyResourceGroupName -n MyVirtualMachineName --command-id RunPowerShellScript --scripts "Enable-WindowsOptionalFeature -FeatureName IIS-HttpTracing -Online -All"
Deploy your application.
Set the Profiler sink by using Azure Resource Explorer
Because the Azure portal doesn't provide a way to set the Application Insights Profiler for .NET sink, you can use Azure Resource Explorer to set the sink.
नोट
If you deploy the VM again, the sink will be lost. You need to update the config you use when you deploy the VM to preserve this setting.
Verify that the Microsoft Azure Diagnostics extension is installed by viewing the extensions installed for your virtual machine.
Expand subscriptions and find the subscription that holds the resource group with your VM.
Drill down to your VM extensions by selecting your resource group. Then select Microsoft.Compute > virtualMachines > [your virtual machine] > extensions.
Add the Application Insights Profiler for .NET sink to the SinksConfig node under WadCfg. If you don't already have a SinksConfig section, you might need to add one. To add the sink:
Specify the proper Application Insights iKey in your settings.
Switch the Explorer mode to Read/Write in the upper-right corner.