• /
  • EnglishEspañolFrançais日本語한국어Português
  • Log inStart now

Windows instrumentation

You can configure Azure Functions monitoring for Windows by instrumenting your Azure Function with the New Relic .NET agent, Python agent, or Node.js agent. This allows you to monitor the performance and health of your Azure Functions in real-time.

Prerequisites

Configure Azure Functions monitoring

You can configure Azure Functions monitoring for different environments and various combinations of runtimes and deployment methods:

  1. In the root directory of your Node.js Azure Function App project, install the New Relic agent as a project dependency by running:

    npm i newrelic
  2. To ensure that the New Relic agent is installed with your project dependencies during the Azure deployment process, set the SCM_DO_BUILD_DURING_DEPLOYMENT to true in your application settings by running:

    az functionapp config appsettings set --name <your-function-app-name> --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true
  3. Publish your Azure Function App using the Azure CLI or your preferred publishing method. You can use one of the following command to publish your Azure Function App:

    func azure functionapp publish {NAME_OF_YOUR_AZURE_FUNCTION_APP}

    OR

    az functionapp app up

    OR

    az functionapp deploy

    Important

    The commands given here are examples and may require additional parameters based on your specific Azure configuration and deployment strategy such as OS, Node.js version, Azure resource group, Azure subscription, Azure storage account, Azure region, and so on. Refer to Azure documentation to know more about these parameters for func azure functionapp publish, az functionapp up, and az functionapp deploy methods.

You can instrument your Azure Function with the New Relic .NET agent on Windows in the following ways:

Configure environment variables

After you've instrumented your Azure Function with the New Relic, configure environment variables:

  1. Navigate to your Azure Function in the Azure portal.
  2. Under Settings, click Environment variables, and then click Advanced edit.
  3. Based on your deployment environment, paste the following values:

Important

Ensure that you add a comma at the end of the last existing line and update your license key in the following configurations.

{
"NODE_OPTIONS": "-r newrelic",
"NEW_RELIC_LICENSE_KEY": "YOUR-NEW-RELIC-INGEST-LICENSE-KEY",
"NEW_RELIC_APP_NAME": "NAME-OF-THE-FUNCTION-APP"
}

New Relic Azure Websites Extension:

{
"name": "NEW_RELIC_LICENSE_KEY",
"value": "<your New Relic ingest license key here>",
"slotSetting": false
}

The Azure websites extension automatically configures all other required environment variables.

Optionally, you can specify the version of the .NET agent you want to install by adding the following environment variable:

{
"name": "NEW_RELIC_AGENT_VERSION_OVERRIDE",
"value": "10.38.0",
"slotSetting": false
}

NewRelic.Agent Nuget package:

({
"name": "CORECLR_ENABLE_PROFILING",
"value": "1",
"slotSetting": false
},
{
"name": "CORECLR_NEW_RELIC_HOME",
"value": "C:\\home\\site\\wwwroot\\newrelic",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER",
"value": "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER_PATH_32",
"value": "C:\\home\\site\\wwwroot\\newrelic\\x86\\NewRelic.Profiler.dll",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER_PATH_64",
"value": "C:\\home\\site\\wwwroot\\newrelic\\NewRelic.Profiler.dll",
"slotSetting": false
},
{
"name": "COR_ENABLE_PROFILING",
"value": "1",
"slotSetting": false
},
{
"name": "NEW_RELIC_HOME",
"value": "C:\\home\\site\\wwwroot\\newrelic",
"slotSetting": false
},
{
"name": "COR_PROFILER",
"value": "{71DA0A04-7777-4EC6-9643-7D28B46A8A41}",
"slotSetting": false
},
{
"name": "COR_PROFILER_PATH_32",
"value": "C:\\home\\site\\wwwroot\\newrelic\\x86\\NewRelic.Profiler.dll",
"slotSetting": false
},
{
"name": "COR_PROFILER_PATH_64",
"value": "C:\\home\\site\\wwwroot\\newrelic\\NewRelic.Profiler.dll",
"slotSetting": false
},
{
"name": "NEW_RELIC_LOG_DIRECTORY",
"value": "C:\\home\\LogFiles\\NewRelic",
"slotSetting": false
},
{
"name": "NEW_RELIC_LICENSE_KEY",
"value": "<your New Relic ingest license key here>",
"slotSetting": false
})

Restart your Azure Function

After you've added the environment variables, restart your Azure Function to apply the changes.

Find and use data

After you have configured your Azure Function, you can find and use the data in the New Relic UI.

  1. Go to https://one.newrelic.com > APM & Services.
  2. In the search banner, set the search criteria as isAzureFunction = true: A screenshot showing the Azure Function search
  3. From the displayed list, select your Azure Function to view the data.

Compatibility and requirements

Requirements for your Azure Functions

Linux instrumentation

Learn how to set up your Azure Functions for Linux to monitor them in New Relic.

Container instrumentation

Learn how to set up your Azure Functions for Containers to monitor them in New Relic.

Copyright © 2025 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.