After installing New Relic's .NET agent for Azure, you have one or more of the following problems:
- You don't see any data.
- You notice the application name appear in New Relic, but there's missing data.
Important things to verify and understand:
- Ensure that the installation and execution steps have been followed.
- You must disable Application Insights in order for the .NET agent to work properly.
- Beginning with .NET agent version 18.104.22.168, Azure's
Always Onsetting may be enabled without interfering with the agent. If your application targets .NET Framework 4.0 or lower,
Always Onwill interfere with the agent and the workarounds here are still applicable.
You can use Kudu to check for agent logs, which is a site that runs in parallel with your website and provides various tools that can be used to examine processes, look at the file system, and download files and directories.
If your website's URL is
example.azurewebsites.net, then the Kudu site is
example.scm.azurewebsites.net. Use your site's deployment credentials to log into the Kudu site.
Important tips when checking for logs:
- When using the New Relic Azure Site Extension, assuming that your Azure Web App uses a
D:file system root, the log location defaults to
D:\home\LogFiles\NewRelic. If your Azure Web uses a
C:root, you'll need to use the correct drive letter.
- If you installed the agent with the
NewRelic.Azure.WebSitesNuGet package, you'll find the
logsfolder in the directory where the agent was extracted within your project. This is often the
newrelicfolder within the
To check for agent logs:
- Make sure you're looking at current data. Delete or move any existing files in the logs directory so that you're sure the logs you generate reflect the current state of your system.
- Restart your application.
- Exercise your application for at least a few minutes in a way that would generate traffic you'd expect to see in your New Relic account.
- Make note of the process ID (PID) your application is running under, so you can verify if a log is being created for that process. You can find the PID by using Kudu's built-in Process Explorer.
- Go back to the agent logs directory, and look for a log file with a name containing the process ID of your application, for example,
- If you see that profiler log file in the logs directory, then also check to see if there is a corresponding agent log. The agent log contains the prefix
newrelic_agent. If you're running multiple .NET applications on your host, there may be more than one of these. If you see one or more you must determine which corresponds to the application you're trying to monitor.
- Search in the agent log for the string
(pid [your PID]), for example
(pid 1573). If you find that string in the log file, then you know it's the agent log associated with your application.
- Look for network or other errors that could cause the agent to fail to send data to New Relic.
To check if the profiler is loaded:
- Use Kudu's built-in Process Explorer for Windows installs. For Linux installs, reference the commands in this article.
- In Process Explorer, find the process you're trying to monitor, and make note of the number in the PID column. If you're trying to monitor a web application, the process name will likely be
w3wp.exewithout the SCM label, which refers to the Kudu process itself. The agent shouldn't instrument the SCM (Kudu) process.
- When you've located your application's process, click on the
- Click the Modules tab, and look for
NewRelic.Profiler.dll— this DLL is required for the agent to monitor your application. If you can't find it, make sure the correct environment variables are present (more on this in step 3), and Microsoft Application Insights is disabled.
If you don't see
NewRelic.Profiler.dll, continue to the next step. If you do see this DLL, and the app is receiving traffic, you should be seeing logs as described in step 1.
To check for the required environment variables:
- In Process Explorer, locate your application's process, and click on the
- Select the Environment tab.
If the correct variables are set and the application you're trying to monitor has access to them, you should see a particular set of environment variables, depending on whether the agents you have installed are .NET Framework or .NET Core.
These examples all assume that your Azure Web App uses a
D: file system root. If your Azure Web uses a
C: root, you need to use the correct drive letter when configuring these paths.
For further reading on these environment variables and their functionality, see how to understand .NET agent env variables.
If the application name is showing up in New Relic, but no transactions are appearing, it's likely because either no traffic is hitting the app, or the agent is not encountering a known framework that it can automatically instrument:
- For .NET Framework automatically instrumented frameworks, refer to our compatibility page.
- For .NET Core automatically instrumented frameworks, refer to our compatibility page.
- If your application does not use one of those compatible app frameworks, you may need to implement custom instrumentation to tell the agent what parts of your application are important for monitoring and what constitutes the scope of a transaction.
If the above steps didn't help you fix your issues, we recommend you to contact support or ask for help on our Support Forum.