# newrelic/newrelic-azure-functions architecture

> Architecture diagram of the GitHub repository newrelic/newrelic-azure-functions, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/newrelic/newrelic-azure-functions
- Repository: https://github.com/newrelic/newrelic-azure-functions

## Overview

New Relic Azure Functions collects logs from Azure Event Hubs and Blob Storage, normalizes and enriches them, then compresses and forwards them to New Relic Logs. The principal runtime path is registered source handler → shared processing in `LogForwarder/index.js` → New Relic. The README also documents ARM templates for automating deployment, represented as a separate capability. The source excerpt shows the shared processing and send path; the individual template behavior is not sampled, so no deployment-flow links are inferred.

Main entry points: [`LogForwarder/index.js`](https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js) (Shared Handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Log Forwarders"]
  node_eventhub_handler["Event Hub Handler<br/>[index.js]"]
  node_blob_handler["Blob Handler<br/>[index.js]"]
end

subgraph group_processing["Log Processing"]
  node_main["Shared Handler<br/>[index.js]"]
  node_transform["Parse and Transform<br/>[index.js]"]
  node_metadata["Add Metadata<br/>[index.js]"]
  node_timestamps["Add Timestamps<br/>[index.js]"]
  node_compress_send["Compress and Send<br/>[index.js]"]
end

subgraph group_deployment["Deployment Templates"]
  node_blob_arm["Blob ARM Template"]
  node_eventhub_arm["Event Hub ARM Template"]
  node_activity_bicep["Activity Log Bicep"]
  node_eventhub_bicep["Event Hub Bicep"]
end

node_azure_eventhub(("Azure Event Hubs"))
node_azure_blob(("Azure Blob Storage"))
node_newrelic_logs(("New Relic Logs API"))

node_azure_eventhub -->|"provides logs"| node_eventhub_handler
node_eventhub_handler -->|"invokes"| node_main
node_azure_blob -->|"provides logs"| node_blob_handler
node_blob_handler -->|"invokes"| node_main
node_main -->|"transforms"| node_transform
node_main -->|"adds metadata"| node_metadata
node_main -->|"adds timestamps"| node_timestamps
node_main -->|"sends payload"| node_compress_send
node_compress_send -->|"posts logs"| node_newrelic_logs

click node_eventhub_handler "https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js"
click node_blob_handler "https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js"
click node_main "https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js"
click node_transform "https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js"
click node_metadata "https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js"
click node_timestamps "https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js"
click node_compress_send "https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js"
click node_blob_arm "https://github.com/newrelic/newrelic-azure-functions/blob/master/armTemplates/azuredeploy-blobforwarder.json"
click node_eventhub_arm "https://github.com/newrelic/newrelic-azure-functions/blob/master/armTemplates/azuredeploy-eventhubforwarder.json"
click node_activity_bicep "https://github.com/newrelic/newrelic-azure-functions/blob/master/bicep/activityLogConfiguration.bicep"
click node_eventhub_bicep "https://github.com/newrelic/newrelic-azure-functions/blob/master/bicep/azuredeploy-eventhubforwarder.bicep"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_eventhub_handler,node_blob_handler toneBlue
class node_main,node_transform,node_metadata,node_timestamps,node_compress_send,node_azure_blob toneAmber
class node_blob_arm,node_eventhub_arm,node_activity_bicep,node_eventhub_bicep,node_newrelic_logs toneMint
class node_azure_eventhub toneIndigo
```

## Components

### Log Forwarders

- [Event Hub Handler](https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js): `LogForwarder/index.js`
- [Blob Handler](https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js): `LogForwarder/index.js`

### Log Processing

- [Shared Handler](https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js): `LogForwarder/index.js`
- [Parse and Transform](https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js): `LogForwarder/index.js`
- [Add Metadata](https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js): `LogForwarder/index.js`
- [Add Timestamps](https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js): `LogForwarder/index.js`
- [Compress and Send](https://github.com/newrelic/newrelic-azure-functions/blob/master/LogForwarder/index.js): `LogForwarder/index.js`

### Deployment Templates

- [Blob ARM Template](https://github.com/newrelic/newrelic-azure-functions/blob/master/armTemplates/azuredeploy-blobforwarder.json): `armTemplates/azuredeploy-blobforwarder.json`
- [Event Hub ARM Template](https://github.com/newrelic/newrelic-azure-functions/blob/master/armTemplates/azuredeploy-eventhubforwarder.json): `armTemplates/azuredeploy-eventhubforwarder.json`
- [Activity Log Bicep](https://github.com/newrelic/newrelic-azure-functions/blob/master/bicep/activityLogConfiguration.bicep): `bicep/activityLogConfiguration.bicep`
- [Event Hub Bicep](https://github.com/newrelic/newrelic-azure-functions/blob/master/bicep/azuredeploy-eventhubforwarder.bicep): `bicep/azuredeploy-eventhubforwarder.bicep`

### Other components

- **Azure Event Hubs**
- **Azure Blob Storage**
- **New Relic Logs API**

## Connections

- Azure Event Hubs → Event Hub Handler: provides logs (evidence: `README.md`)
- Event Hub Handler → Shared Handler: invokes (evidence: `LogForwarder/index.js`)
- Azure Blob Storage → Blob Handler: provides logs (evidence: `README.md`)
- Blob Handler → Shared Handler: invokes (evidence: `LogForwarder/index.js`)
- Shared Handler → Parse and Transform: transforms (evidence: `LogForwarder/index.js`)
- Shared Handler → Add Metadata: adds metadata (evidence: `LogForwarder/index.js`)
- Shared Handler → Add Timestamps: adds timestamps (evidence: `LogForwarder/index.js`)
- Shared Handler → Compress and Send: sends payload (evidence: `LogForwarder/index.js`)
- Compress and Send → New Relic Logs API: posts logs (evidence: `LogForwarder/index.js`)
