General Troubleshooting: Dynamic .NET Agent in Azure App Services
Check the Logs
BASE_DIR\vfunction\logs\instances\default-dotnet\vfagent.net.log
When the Application is successfully hooked, the vFunction Agent’s logging will be written to this file. Typically, the location for this will be C:\home\vfunction\logs\instances\default-dotnet\vfagent.net.log. This file can be opened via the Advanced Tools’s Kudu Powershell Debug Console.
C:\Temp\log\vfagent.net.log
If the vFunction Agent cannot write to the BASE_DIR\vfunction directory, the vfagent.net.log will be created in the C:\Temp\log directory. The typically scenario when this log is written is when the installation.yaml’s agent.application_name is set and the vFunction Agent is dropping out of processes that do not match the naming convention that the vFunction Agent is trying to match.
Check Process Explorer
Application Insights is a subprocess
In the Kudu Debug Console, select Process Explorer from the Menu Bar. Under the w3wp.exe process, confirm that there are no other Agents that are hooked into the Application. For example, if enabled, Application Insights will override the vFunction Agent as only one .NET Agent can be hooked into an application at a time. To temporarily disable Application Insights:
- Open the Environment Variables for the Azure App
- Copy-and-paste the ApplicationInsights_InstrumentationKey into a location to be saved for later use
- Remove the Environment Variable ApplicationInsights_InstrumentationKey
- Restart the Application
The w3wp process version does not match what is set in the installation.yaml
vFunction tries to hook into the 64-bit w3wp process by default. If the 64-bit w3wp process is used, in the Kudu Debug Console’s Process Explorer, you’ll see that the w3wp process is running from C:\windows\sysWOW64. If the 32-bit w3wp process is being used by the application, you’ll see the w3wp process is running from C:\windows\system32. If needed, modify the installation.yaml’s agent.architecture.
The w3wp application name does not match what is set in the installation.yaml
vFunction drops out of any process that does not exactly match the value in the installation.yaml’s agent.application_name. Check the Kudu Debug Console’s Process Explore to see the Application Name. The Application Name will be quote-enclosed and follow the -ap flags. Often, this Application Name starts as ~1 in Azure App Services.