Azure Websites

If your application runs on Microsoft's Azure Websites platform, follow this procedure to install New Relic's .NET agent. If your application runs on the Azure Cloud Services platform, see Azure Cloud Services.

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 .

Note: 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.

Standard installation with NuGet


[video link] For a video overview of Azure installation, watch this video (approximately 3 minutes).

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

  1. Sign in to manage.windowsazure.com. If you do not have an existing Azure Website to instrument, create an Azure Website.
  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 Websites > (selected website) > Configure.
    3. Set the Performance Monitoring toggle to Add-On, then select NewRelic from the Choose Add-On drop down. Select Save.
    Existing New Relic account
    1. Copy your license key.
    2. From the Azure sidebar, select Websites > (selected website) > Configure.
    3. Set the Performance Monitoring toggle to Custom, then select New Relic from the Provider drop down.
    4. Insert your license key in the Provider Key field. Select Save.
  3. Verify your Azure version. From the Azure sidebar, select Websites > (selected website) > Configure. Find the Platform toggle, and determine whether your website is running on the 32-bit or 64-bit platform.
  4. Install the New Relic NuGet package. Select your app in Visual Studio, then run the appropriate command from the Package manger 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 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 Websites > (selected website) > 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.
  6. Publish your website to Azure.
  7. Generate traffic to your website. Wait a few minutes, then check your app's performance!
screen-azure-addon.png
Azure sidebar > Websites > (selected website) 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 kAdd-On drop down.

Checking 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 your New Relic dashboard:

  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 the standard New Relic user interface features. If no data appears, see No data appears (Azure Website).

Using 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 dashboard shows current app server and browser information.

After you select an application from New Relic APM's Applications list, the Overview dashboard shows current information about your app's server requests, browser page load time, or other transaction information as applicable. For more information about using New Relic, see Applications Overview dashboard, The New Relic UI, and Standard dashboard features.

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 Website before deploying. You can then use the manual installation process to deploy New Relic to your Azure Website:

  1. Sign in to manage.windowsazure.com. If you do not have an existing Azure Website to instrument, create an Azure Website.
  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 Websites > (selected website) > Configure.
    3. Set the Performance Monitoring toggle to Add-On, then select NewRelic from the Choose Add-On drop down. Select Save.
    Existing New Relic account
    1. Copy your license key.
    2. From the Azure sidebar, select Websites > (selected website) > Configure.
    3. Set the Performance Monitoring toggle to Custom, then select New Relic from the Provider drop down.
    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 Website.
  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 Website 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, disable the Always On setting. From the Azure sidebar, select Websites > (selected website) > Configure, and set the Always On toggle to off.
  7. Generate traffic to your website. Wait a few minutes, then check your app's performance!

Configuration key values

The Azure Website 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 C:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll
NEWRELIC_HOME C:\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 > Websites > (website 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 "MyWebSiteName" with your website's name.
    $appName = "MyWebSiteName"
    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=C:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll" $appName
    azure site config add "NEWRELIC_HOME=C:\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 > Websites > (website name) > Download the publish profile.
  4. Execute the following command in a PowerShell console:
    Import-AzurePublishSettingsFile "PathToPublishSettingsFile"
  5. Execute the PowerShell script below, replacing "MyWebSiteName" with your website's name.
    $appName = "MyWebSiteName"
    $appSettings = @{ `
        "COR_ENABLE_PROFILING" = "1"; `
        "COR_PROFILER" = "{71DA0A04-7777-4EC6-9643-7D28B46A8A41}"; `
        "COR_PROFILER_PATH" = "C:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll"; `
        "NEWRELIC_HOME" = "C:\Home\site\wwwroot\newrelic" `
    }
    
    Set-AzureWebsite -Name $appName -AppSettings $appSettings

Known issues

Here is a summary of known issues you might experience when installing the .NET agent on a Windows Azure Website.

Website issues Comments
No data appears

If no data appears within five minutes, Azure's Always On setting may be conflicting with New Relic. This feature is only available in Azure's Basic and Standard modes.

Workaround: Disable Always On. From the Azure sidebar, select Websites > (selected website) > Configure, and set the Always On toggle to off.

Log file locking

When connecting via FTP to their Azure Website, you are able to see a NewRelic.Profiler.####.log file in LogFiles\NewRelic\. However, attempting to access that file causes an error message.

Workaround: Restart your website to release the file and create a new profile log.

Profiler dll locking during deploy

When deploying a new version of the New Relic agent (NewRelic.Profiler.dll), an error message states that the user cannot do anything until they stop or restart the process. The expected behavior is that the process stops, then the assets get overwritten during a deployment with the ones New Relic packs up in the site root (located at: C:\Home\site\wwwroot\newrelic).

Workaround: You can stop your website to release the file and allow the update to take place. Once the deploy is complete you can restart the instance. This will only happen if you are attempting to deploy a new version (over an existing one) of the .NET agent to an Azure Website.

For more help

Additional documentation resources include:

  • Installing the .NET agent on Azure (overview and special pricing for using New Relic's .NET agent with Windows Azure)
  • Azure Cloud Services (New Relic's installation procedures for Azure Cloud Services, including Web and Worker Roles)
  • Azure Preview Portal (Installing and using New Relic .NET agent on new Azure Portal [currently in Preview])
  • Apdex (overview of how Apdex measures end users' satisfaction with your application)
  • Page load timing process (overview of page load timing, sometimes referred to as real user monitoring or RUM, including time segments and colors, differences between app server requests and page load timing, outliers)
  • Finding help (resources available through New Relic's online Help Center)

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