• /
  • EnglishEspañolFrançais日本語한국어Português
  • Inicia sesiónComenzar ahora

Linux instrumentation

You can configure New Relic monitoring for Azure Function Apps hosted on Linux. This is achieved by instrumenting your Function App with the appropriate New Relic agent for its runtime such as Node.js, .NET, or Python. This instrumentation allows you to monitor the performance and health of your Azure Functions in real-time within New Relic.

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 {NAME_OF_YOUR_AZURE_FUNCTION_APP} --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 commands 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

    Importante

    The commands shown 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.

  1. In the root directory of your Python Azure Function App project, open the requirements.txt file.

  2. Add the following line to your requirements.txt file to install the New Relic agent for Azure Function instrumentation:

    bash
    $
    newrelic
  3. Initialize and register the New Relic agent in your Azure Function code using one of the following methods:

  4. Publish your Azure Function App using the Azure CLI or your preferred publishing method. You can use the following command to publish your Azure Function App:

    bash
    $
    func azure functionapp publish ${NAME_OF_YOUR_AZURE_FUNCTION_APP}
  1. Add the latest version of the NewRelic.Agent NuGet package to your application project.

  2. Use your preferred publishing mechanism to deploy your updated application to Azure.

    When you deploy your application, the .NET agent is installed in the /home/site/wwwroot/newrelic folder.

Configure environment variables

After you've published the Azure Function app, 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 runtime, paste the following values:

Importante

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_LICENSE_KEY": "YOUR-NEW-RELIC-LICENSE-KEY",
"NEW_RELIC_APP_NAME": "NAME-OF-THE-FUNCTION-APP",
"PYTHONPATH": "${PYTHONPATH}:/home/site/wwwroot:/home/site/wwwroot/.python_packages/lib/site-packages",
"FUNCTIONS_WORKER_RUNTIME": "python",
"PYTHON_ENABLE_WORKER_EXTENSIONS": 1
}
({
"name": "CORECLR_ENABLE_PROFILING",
"value": "1",
"slotSetting": false
},
{
"name": "CORECLR_NEW_RELIC_HOME",
"value": "/home/site/wwwroot/newrelic",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER",
"value": "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}",
"slotSetting": false
},
{
"name": "CORECLR_PROFILER_PATH",
"value": "/home/site/wwwroot/newrelic/libNewRelicProfiler.so",
"slotSetting": false
},
{
"name": "NEW_RELIC_LOG_DIRECTORY",
"value": "/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

Windows instrumentation

Learn how to set up your Azure Functions for Windows 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.