---
title: Environment variables for Azure function monitoring
source: https://docs.newrelic.com/docs/serverless-function-monitoring/azure-function-monitoring/env-variables-azure
---

Environment variables are a way to store configuration and secrets outside of your code. The following tables display the mandatory variables and runtime specific variables that you can set to monitor your Azure functions with New Relic.

## Mandatory environment variables

Regardless of your runtime, you must set the following environment variables to monitor your Azure functions with New Relic:

| Variable Name           | Description                                                     |
| ----------------------- | --------------------------------------------------------------- |
| `NEW_RELIC_ACCOUNT_ID`  | Specifies your New Relic account ID                             |
| `NEW_RELIC_LICENSE_KEY` | Specifies your New Relic ingest key, overriding Secrets Manager |

## Additional environment variables

Based on your runtime, you can set the following environment variables to further configure the New Relic Azure Functions monitoring:

### Node.js

| Environment variable | Default value | Options       | Description                                                                         |
| -------------------- | ------------- | ------------- | ----------------------------------------------------------------------------------- |
| `NODE_OPTIONS`       |               | `-r newrelic` | **Required**: Inject the agent before your Azure application functions are invoked. |
| `NEW_RELIC_APP_NAME` |               |               | Set the application name, though it is not used in the New Relic UI                 |

You can find more environment variables in our [Node.js configuration documentation](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration/).

### Python

| Environment variable                    | Default value | Options                                                                                  | Description                                                                                                                                                                                                       |
| --------------------------------------- | ------------- | ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NEW_RELIC_APP_NAME`                    |               |                                                                                          | Set the application name, though it is not used in the New Relic UI                                                                                                                                               |
| `FUNCTIONS_WORKER_RUNTIME`              |               | `"python"`                                                                               | Set the value to `python`.                                                                                                                                                                                        |
| `PYTHON_ENABLE_WORKER_EXTENSIONS`       |               | `1`                                                                                      | Enable the python worker extension.                                                                                                                                                                               |
| `PYTHONPATH`                            |               | `${PYTHONPATH}:/home/site/wwwroot:/home/site/wwwroot/.python_packages/lib/site-packages` | Add the installation path of modules installed using `requirements.txt` file to the Python import search paths for your Azure Function App. This ensures that `import` statements can find and use these modules. |
| `NEW_RELIC_SERVERLESS_MODE_ENABLED`     | `false`       | `true`, `false`                                                                          | Enable serverless mode by setting this to `true`                                                                                                                                                                  |
| `NEW_RELIC_DISTRIBUTED_TRACING_ENABLED` | `true`        | `true`, `false`                                                                          | Generate traces by enabling Distributed Tracing                                                                                                                                                                   |

You can find more environment variables in our [Python configuration documentation](https://docs.newrelic.com/docs/apm/agents/python-agent/configuration/python-agent-configuration/).

### .NET

| Environment variable                    | Default value | Options  | Description                                                                                                            |
| --------------------------------------- | ------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED` | `1`           | `1`, `0` | Azure Function mode is enabled by default. You can disable Azure Function instrumentation by setting the value to `0`. |

You can find more environment variables in our [.NET configuration documentation](https://docs.newrelic.com/docs/apm/agents/net-agent/configuration/net-agent-configuration/).

## Related articles [#related-docs]

[Compatibility and requirements](https://docs.newrelic.com/docs/serverless-function-monitoring/azure-function-monitoring/compatibility-requirement-azure-monitoring)

Requirements for your Azure Functions

[Windows instrumentation](https://docs.newrelic.com/docs/serverless-function-monitoring/azure-function-monitoring/windows)

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

[Container instrumentation](https://docs.newrelic.com/docs/serverless-function-monitoring/azure-function-monitoring/container)

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