Azure Classic Portal Web Apps

If your application runs on Microsoft's Azure Classic Portal platform, follow this procedure to install New Relic's .NET agent.

Special pricing

New Relic has partnered with Microsoft to provide discounted pricing when you sign up through the Windows Azure Store. For specific pricing details, see New Relic in the Azure Store .

If you install the .NET agent for your Windows Azure app directly from New Relic's website rather than through the Windows Azure Store, the special pricing offer does not apply.

 

[video link] For an overview of Azure installation, watch this video (approximately 3 minutes). View more videos and tutorials at learn.newrelic.com.

Standard installation with NuGet

If you are familiar with New Relic, Azure, and NuGet, this summarizes how to add New Relic to your Azure-deployed web app. For multi-project solutions, make sure you have selected the correct project (for example, a specific web app project) before installing the NuGet package.

  1. Sign in to manage.windowsazure.com. If you do not have an existing Azure Web App to instrument, create an Azure Web App.
  2. Enable New Relic. This procedure varies depending on whether you have an existing New Relic account:
    No New Relic account
    1. Add the New Relic add-on to your Azure account. From the Azure sidebar, select Add-Ons > Purchase Add-Ons > New Relic > (select a plan) > Purchase.
    2. From the Azure sidebar, select Web Apps > (selected web app) > Configure.
    3. Set the Performance Monitoring toggle to Add-On, then select NewRelic from the Choose Add-On dropdown. Select Save.
    Existing New Relic account
    1. Copy your license key.
    2. From the Azure sidebar, select Web Apps > (selected web app) > Configure.
    3. Set the Performance Monitoring toggle to Custom, then select New Relic from the Provider dropdown.
    4. Insert your license key in the Provider Key field. Select Save.
  3. Verify your Azure version. From the Azure sidebar, select Web Apps > (selected web app) > Configure. Find the Platform toggle, and determine whether your web app is running on the 32-bit or 64-bit platform.
  4. Install the New Relic NuGet package. Select your app in Visual Studio, and then run the appropriate command from the Package manager console:
    • 32-bit: Install-Package NewRelic.Azure.WebSites
    • 64-bit: Install-Package NewRelic.Azure.WebSites.x64
  5. If you are using Azure's Standard or Basic tiers and you have enabled the Always On setting, be sure to disable it: From the Azure sidebar, select Web Apps > (selected web app) > Configure, and then set the Always On toggle to Off.
  6. Publish your web app to Azure.
  7. Generate traffic to your web app. Wait a few minutes, and then check your app's performance.
screen-azure-addon.png
Azure sidebar > Web Apps > (selected web app) Configure: After purchasing the New Relic addon, enable New Relic for your Azure Web Site by setting the Performance Monitoring toggle to Add-On, then selecting NewRelic from the Choose Add-On dropdown.

Check your app's performance

Your application must receive traffic in order for you to view its performance in New Relic. You may need to wait a few minutes for data to start appearing. To check out your application's performance in New Relic:

  1. From the Azure sidebar, select Add Ons > New Relic > Go to the New Relic, Inc. website for the next steps.
  2. Review and accept the New Relic terms of service.
  3. View your app's performance using tany of New Relic's standard user interface functions and page functions to drill down into detailed information.

If no data appears, see No data appears (Azure Web App).

Use New Relic

screen app overview server.png
Applications > (selected app) > Monitoring > Overview: After you select an application from New Relic APM's Applications list, the Overview page shows current app server and browser information.

After you select an application from New Relic APM's Applications list, the Overview page shows current information about your app's server requests, browser page load time, or other transaction information as applicable. Use any of New Relic's standard user interface functions and page functions to drill down into detailed information

Manual installation

Typically you should be able to use the NewRelic.Azure.WebSites NuGet package to install New Relic. However, there may be times when you cannot execute a package on your Azure Web App before deploying. You can then use the manual installation process to deploy New Relic to your Azure Web App:

  1. Sign in to manage.windowsazure.com. If you do not have an existing Azure Web App to instrument, create an Azure Web App.
  2. Enable New Relic. This procedure varies depending on whether you have an existing New Relic account:
    No New Relic account
    1. Add the New Relic add-on to your Azure account. From the Azure sidebar, select Add-Ons > Purchase Add-Ons > New Relic > (select a plan) > Purchase.
    2. From the Azure sidebar, select Web Apps > (selected web app) > Configure.
    3. Set the Performance Monitoring toggle to Add-On, then select NewRelic from the Choose Add-On dropdown. Select Save.
    Existing New Relic account
    1. Copy your license key.
    2. From the Azure sidebar, select Web Apps > (selected web app) > Configure.
    3. Set the Performance Monitoring toggle to Custom, then select New Relic from the Provider dropdown.
    4. Insert your license key in the Provider Key field. Select Save.
  3. From New Relic's GitHub repository, add the newrelic folder containing the .NET agent to the root of your Azure Web App.
  4. Optional: Customize the name of your application by editing the <application> element in newrelic.config. If you do not customize the application name, the name defaults to the name of your Windows Azure Web App as defined in the Azure portal.
  5. Deploy your application to Azure via Source Control, Web Deploy, Web Matrix, or FTP.
  6. If you are using Azure's Standard or Basic tiers and you have enabled the Always On setting then you must either disable the Always On setting or explicitly name your app in its web.config:

    • To disable the Always On setting, select Web Apps > (selected web app) > Configure from the Azure sidebar, and set the Always On toggle to off.
    • To explicitly name your app, add the element <add key="NewRelic.AppName" value="NameOfApp"/> to the <appSettings> element in your web.config.
  7. Generate traffic to your web app. Wait a few minutes, and then check your app's performance.

Configuration key values

The Azure Web App installation process automatically adds these configuration key values in the App settings.

Key Value
COR_ENABLE_PROFILING 1
COR_PROFILER {71DA0A04-7777-4EC6-9643-7D28B46A8A41}
COR_PROFILER_PATH D:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll
NEWRELIC_HOME D:\Home\site\wwwroot\newrelic

Optionally you can set these variables via the CLI tool or PowerShell SDK:

Cross-Platform CLI tool

To use the Cross-Platform CLI tool :

  1. Download and install the Cross-Platform CLI tool.
  2. Add your Publish Profile using the SDK.
  3. Sign in to manage.windowsazure.com > Web Apps > (web app name) > Download the publish profile.
  4. Execute the following commands in a PowerShell console:
    azure account download "Subscription Name"
    azure account import "PathToPublishSettingsFile"
  5. Execute the PowerShell script below, replacing "MyWebAppName" with your web app's name.
    $appName = "MyWebAppName"
    azure site config add "COR_ENABLE_PROFILING=1" $appName
    azure site config add "COR_PROFILER={71DA0A04-7777-4EC6-9643-7D28B46A8A41}" $appName
    azure site config add "COR_PROFILER_PATH=D:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll" $appName
    azure site config add "NEWRELIC_HOME=D:\Home\site\wwwroot\newrelic" $appName
Azure PowerShell SDK

To use the Azure PowerShell SDK :

  1. Download and install the Azure PowerShell SDK.
  2. Add your Publish Profile using the SDK.
  3. Sign in to manage.windowsazure.com > Web Apps > (web app name) > Download the publish profile.
  4. Execute the following command in a PowerShell console:
    Import-AzurePublishSettingsFile "PathToPublishSettingsFile"
  5. Execute the PowerShell script below, replacing "MyWebAppName" with your web app's name.
    $appName = "MyWebAppName"
    $appSettings = @{ `
        "COR_ENABLE_PROFILING" = "1"; `
        "COR_PROFILER" = "{71DA0A04-7777-4EC6-9643-7D28B46A8A41}"; `
        "COR_PROFILER_PATH" = "D:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll"; `
        "NEWRELIC_HOME" = "D:\Home\site\wwwroot\newrelic" `
    }
    
    Set-AzureWebsite -Name $appName -AppSettings $appSettings

For more help

Additional documentation resources include:

Join the discussion about .NET monitoring in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.