# jordanbean-msft/az-event-hub-function-logging architecture

> Architecture diagram of the GitHub repository jordanbean-msft/az-event-hub-function-logging, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jordanbean-msft/az-event-hub-function-logging
- Repository: https://github.com/jordanbean-msft/az-event-hub-function-logging

## Overview

##### Main Components

a) Azure Services Components:
- Azure Event Hub
- Azure Functions
- Application Insights
- Log Analytics Workspace
- Storage Account
- Managed Identity

b) Infrastructure Management:
- Terraform Configuration Layer
- Azure Policy Management
- RBAC/Security Components

##### Client/Input Layer
- Event Sources (show incoming data flow)
- Event Hub (primary ingestion point)

##### Processing Layer
- Azure Functions (Python-based SIEM logging function)
- Connection to fields_to_keep.json configuration

##### Storage & Monitoring Layer
- Storage Account
- Application Insights
- Log Analytics Workspace

##### Security & Identity Layer
- Managed Identity
- Policy Enforcement Points

b) Connection Types to Show:

##### Specific Implementation Details

- Purple hexagons for Event Hub components
- Blue rectangles for Azure Functions
- Orange diamonds for security components
- Yellow rectangles for monitoring components

##### Important Relationships to Highlight

- Event Hub → Azure Function: Primary data ingestion path
- Azure Function → Storage Account: Data persistence
- Managed Identity → All Components: Authentication flow
- Application Insights → Azure Function: Monitoring
- Policy → All Components: Governance enforcement

Create clear sections for:
a) Infrastructure as Code (Terraform)
b) Runtime Components
c) Monitoring & Logging
d) Security & Compliance

##### Additional Elements

- Version information for key components
- Environment boundaries (dev/prod if applicable)
- Scaling components

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Client Layer"
        ES[Event Sources]
        EH["Event Hub"]:::eventhub
    end

    subgraph "Processing Layer"
        AF["Azure Functions"]:::function
        FC["fields_to_keep.json"]:::config
    end

    subgraph "Storage & Monitoring Layer"
        SA["Storage Account"]:::storage
        AI["Application Insights"]:::monitoring
        LA["Log Analytics"]:::monitoring
    end

    subgraph "Security & Identity Layer"
        MI["Managed Identity"]:::security
        POL["Policy Management"]:::security
    end

    subgraph "Infrastructure as Code"
        TF["Terraform Configuration"]:::iac
    end

    ES --> EH
    EH --> AF
    AF --> SA
    AF --> AI
    AF -.-> FC
    AI --> LA
    MI -.-> EH
    MI -.-> AF
    MI -.-> SA
    POL -.-> EH
    POL -.-> AF
    POL -.-> SA
    POL -.-> AI
    TF --> EH
    TF --> AF
    TF --> SA
    TF --> AI
    TF --> LA
    TF --> MI
    TF --> POL

    %% Click Events
    click EH "https://github.com/jordanbean-msft/az-event-hub-function-logging/tree/main/infra/modules/event_hub"
    click AF "https://github.com/jordanbean-msft/az-event-hub-function-logging/blob/main/src/python/siem-logging/function_app.py"
    click FC "https://github.com/jordanbean-msft/az-event-hub-function-logging/blob/main/src/python/siem-logging/fields_to_keep.json"
    click SA "https://github.com/jordanbean-msft/az-event-hub-function-logging/tree/main/infra/modules/storage_account"
    click AI "https://github.com/jordanbean-msft/az-event-hub-function-logging/tree/main/infra/modules/application_insights"
    click LA "https://github.com/jordanbean-msft/az-event-hub-function-logging/tree/main/infra/modules/log_analytics"
    click MI "https://github.com/jordanbean-msft/az-event-hub-function-logging/tree/main/infra/modules/managed_identity"
    click POL "https://github.com/jordanbean-msft/az-event-hub-function-logging/tree/main/infra/modules/policy"
    click TF "https://github.com/jordanbean-msft/az-event-hub-function-logging/blob/main/infra/main.tf"

    classDef eventhub fill:#9932CC,stroke:#333,stroke-width:2px
    classDef function fill:#1E90FF,stroke:#333,stroke-width:2px
    classDef storage fill:#32CD32,stroke:#333,stroke-width:2px
    classDef monitoring fill:#FFD700,stroke:#333,stroke-width:2px
    classDef security fill:#FFA500,stroke:#333,stroke-width:2px
    classDef iac fill:#4169E1,stroke:#333,stroke-width:2px
    classDef config fill:#A9A9A9,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Event Hub Component"]:::eventhub
        L2["Function Component"]:::function
        L3["Storage Component"]:::storage
        L4["Monitoring Component"]:::monitoring
        L5["Security Component"]:::security
        L6["Infrastructure Component"]:::iac
        L7["Configuration File"]:::config
    end
```
