# azure-samples/functions-e2e-blob-pdf-to-text architecture

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

- Interactive diagram: https://gitdiagram.com/azure-samples/functions-e2e-blob-pdf-to-text
- Repository: https://github.com/azure-samples/functions-e2e-blob-pdf-to-text

## Overview

This Azure Functions sample turns PDFs uploaded to Blob Storage into text files. An Event Grid-based blob trigger invokes the processor, which loads PDF pages, extracts and joins their text, then returns the result through a Blob Storage output binding. The README also documents the provisioned Flex Consumption app, managed-identity access, and optional VNet isolation. The runtime relationship is visible in the function source; infrastructure relationships below are documented in the README, not traced through sampled Bicep files.

Main entry points: [`infra/app/processor.bicep`](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/processor.bicep) (Flex Consumption app), [`src/src/functions/PDFProcessor.js`](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/src/src/functions/PDFProcessor.js) (PDF text extraction), [`infra/app/storage-Access.bicep`](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/storage-Access.bicep) (Storage network access), [`infra/app/vnet.bicep`](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/vnet.bicep) (Virtual network)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_processing["PDF processing"]
  node_input[("Unprocessed PDFs")]
  node_trigger["Event Grid blob trigger<br/>[PDFProcessor.js]"]
  node_processor["PDF text extraction<br/>[PDFProcessor.js]"]
  node_pdfjs["PDF.js<br/>[PDFProcessor.js]"]
  node_output[("Processed text")]
end

subgraph group_azure["Azure hosting and security"]
  node_azure_functions["Flex Consumption app<br/>[processor.bicep]"]
  node_identity["Managed identity<br/>[processor.bicep]"]
  node_storage_network["Storage network access"]
  node_vnet["Virtual network<br/>[vnet.bicep]"]
  node_monitoring["Application monitoring<br/>[monitoring.bicep]"]
end

node_uploader(("PDF uploader"))

node_uploader -->|"uploads PDFs"| node_input
node_input -->|"triggers on upload"| node_trigger
node_trigger -->|"invokes handler"| node_processor
node_processor -->|"extracts pages"| node_pdfjs
node_processor -->|"writes extracted text"| node_output
node_azure_functions -.->|"hosts"| node_trigger
node_azure_functions -.->|"uses identity"| node_identity
node_azure_functions -.->|"uses secure access"| node_storage_network
node_storage_network -.->|"uses integration"| node_vnet
node_azure_functions -.->|"emits telemetry"| node_monitoring

click node_trigger "https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/src/src/functions/PDFProcessor.js"
click node_processor "https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/src/src/functions/PDFProcessor.js"
click node_pdfjs "https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/src/src/functions/PDFProcessor.js"
click node_azure_functions "https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/processor.bicep"
click node_identity "https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/processor.bicep"
click node_storage_network "https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/storage-Access.bicep"
click node_vnet "https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/vnet.bicep"
click node_monitoring "https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/core/monitor/monitoring.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_input,node_trigger,node_processor,node_pdfjs,node_output toneBlue
class node_azure_functions,node_identity,node_storage_network,node_vnet,node_monitoring toneAmber
class node_uploader toneIndigo
```

## Components

### PDF processing

- **Unprocessed PDFs**
- [Event Grid blob trigger](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/src/src/functions/PDFProcessor.js): `src/src/functions/PDFProcessor.js`
- [PDF text extraction](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/src/src/functions/PDFProcessor.js): `src/src/functions/PDFProcessor.js`
- [PDF.js](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/src/src/functions/PDFProcessor.js): `src/src/functions/PDFProcessor.js`
- **Processed text**

### Azure hosting and security

- [Flex Consumption app](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/processor.bicep): `infra/app/processor.bicep`
- [Managed identity](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/processor.bicep): `infra/app/processor.bicep`
- [Storage network access](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/storage-Access.bicep): `infra/app/storage-Access.bicep`
- [Virtual network](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/app/vnet.bicep): `infra/app/vnet.bicep`
- [Application monitoring](https://github.com/azure-samples/functions-e2e-blob-pdf-to-text/blob/main/infra/core/monitor/monitoring.bicep): `infra/core/monitor/monitoring.bicep`

### Other components

- **PDF uploader**

## Connections

- PDF uploader → Unprocessed PDFs: uploads PDFs (evidence: `README.md`)
- Unprocessed PDFs → Event Grid blob trigger: triggers on upload (evidence: `src/src/functions/PDFProcessor.js`)
- Event Grid blob trigger → PDF text extraction: invokes handler (evidence: `src/src/functions/PDFProcessor.js`)
- PDF text extraction → PDF.js: extracts pages (evidence: `src/src/functions/PDFProcessor.js`)
- PDF text extraction → Processed text: writes extracted text (evidence: `src/src/functions/PDFProcessor.js`)
- Flex Consumption app → Event Grid blob trigger: hosts
- Flex Consumption app → Managed identity: uses identity
- Flex Consumption app → Storage network access: uses secure access
- Storage network access → Virtual network: uses integration
- Flex Consumption app → Application monitoring: emits telemetry
