GMI · TECHNOLOGY OBSERVATORY // ALL SYSTEMS NOMINAL
ENGINEERED BY LEOPARD DATA

Azure Architecture

Complete Azure cloud infrastructure powering the Grade My Investments platform, deployed via Pulumi Infrastructure as Code.

Production Topology
rendering diagram…
flowchart TB
  user([Investor Browser]):::ext
  admin([Admin User]):::ext
  fd{{Front Door - WAF - TLS 1.2}}:::edge

  subgraph RG[Resource Group gmiapp-prod - Central US]
    direction TB
    subgraph VNET[Virtual Network - NSGs]
      cw[Client Web<br/>Blazor WASM]:::app
      aw[Admin Web<br/>Blazor]:::app
      api[API<br/>Azure Functions]:::app
      vm[Report VM<br/>Linux - Managed Identity]:::vm
    end
    kv[(Key Vault<br/>soft-delete 90d)]:::sec
    db[(MySQL Flexible<br/>35-day PITR backup)]:::data
    blob[(Blob Storage<br/>ZRS - reports-prod)]:::data
  end

  subgraph EXT[External Services]
    ext[Stripe - SendGrid - Twilio<br/>FMP - Anthropic Claude]:::ext2
  end

  user --> fd
  admin --> fd
  fd --> cw
  fd --> aw
  fd --> api
  cw --> api
  aw --> api
  api --> db
  api --> blob
  api --> kv
  api --> ext
  vm --> db
  vm --> blob
  vm --> kv
  vm --> ext

  classDef ext fill:#1b1f27,stroke:#5A616B,color:#C4C0B8;
  classDef ext2 fill:#181b22,stroke:#5A616B,color:#C4C0B8;
  classDef edge fill:#2a2018,stroke:#C0894E,color:#F3EFE8;
  classDef app fill:#1f2630,stroke:#C0894E,color:#F3EFE8;
  classDef vm fill:#241c14,stroke:#E2B583,color:#F3EFE8;
  classDef sec fill:#1d2733,stroke:#5cc8e0,color:#eafaff;
  classDef data fill:#22201a,stroke:#C0894E,color:#EBD3AE;
Production Azure topology — gmiapp-prod · Central US · provisioned by Pulumi (C#)

Azure Resource Diagram

gmi-dev-rg

Central US Region
Virtual Network (10.0.0.0/16)
Client App Subnet
10.0.0.0/24
Client Web App
Admin App Subnet
10.0.1.0/24
Admin Web App
Function App Subnet
10.0.2.0/24
Azure Functions API
MySQL Subnet
10.0.3.0/24
MySQL Flexible Server
VM Subnet
10.0.4.0/24
Report Generator VM
Storage & External Services
Function Storage gmidvstorage
Blob Storage gmidevblob
Azure AD App Authentication
Public IP VM SSH Access

Note: This diagram represents the Development environment. The Production environment follows the same architecture pattern with different naming conventions and potentially different SKUs.

Azure Resources Inventory

Networking
Virtual Network

gmi-dev-vnet (10.0.0.0/16)

4 subnets with delegated access for services + VM subnet
Network Security Group

gmi-dev-vm-nsg

SSH (22), HTTP (80), HTTPS (443) access rules
Public IP Address

gmi-dev-report-vm-public-ip

Static IP for VM SSH access
Compute & Web Apps
App Service Plans

gmi-dev-asp & gmi-dev-function-asp

Standard S1 tier for VNet integration support
Client Web App

gmi-dev-webapp

Blazor Server application with Google OAuth
Admin Web App

gmi-dev-admin-webapp

Administrative interface with Azure AD
Technology Web App

gmi-dev-technology-webapp

This documentation platform
Azure Functions

gmi-dev-functions

.NET 10 Isolated runtime with HTTP triggers
Virtual Machine

gmi-dev-report-vm (Standard_B2ms)

Ubuntu 20.04, 2 vCPU, 8 GB RAM for console apps
Data & Storage
MySQL Flexible Server

gmi-dev-mysql (Standard_B1ms)

MySQL 8.0.21, 20 GB storage, VNet integrated
Function Storage Account

gmidvstorage

Standard_LRS for Azure Functions runtime
Blob Storage Account

gmidevblob

Hot tier for report files and documents

Background Services Deployment Architecture

Linux VM Deployment Overview

The Grade My Investments background services are deployed on a dedicated Ubuntu 20.04 virtual machine (Standard_B2ms: 2 vCPU, 8 GB RAM), providing isolated compute resources for intensive report generation tasks. This deployment architecture ensures optimal performance separation from web applications while maintaining cost efficiency.

Grade My InvestmentsBackground Service Deployment Architecture on Linux VM
VM Configuration
  • Instance Type: Standard_B2ms (2 vCPU, 8 GB RAM)
  • Operating System: Ubuntu 20.04 LTS
  • Disk Storage: Standard_LRS (dev) / Premium_LRS (prod)
  • Network: VNet integrated (10.0.4.0/24 subnet)
  • Public Access: SSH via static public IP (restricted by NSG)
Deployed Services
  • ReportEngine: Report processing and Excel generation
  • ReportGeneratorAlpha: FMP data retrieval and analysis
  • EmailSender: SendGrid email delivery service
  • SmsSender: Twilio SMS delivery service
  • SchedulesEngine: Scheduled report job orchestration
  • BillingEngine: Monthly billing and usage calculations
  • FilePurge: Storage cleanup and management
  • ClaudeAnalysis: AI-powered investment analysis via Claude
  • HealthMonitor: Service health checks and alerting
  • DownloadBuilder: Bulk download ZIP file assembly
  • ReportComparison: Report data validation and comparison
Architecture Benefits
Performance Isolation
  • Dedicated compute resources
  • No resource contention with web apps
  • Optimal CPU allocation for batch processing
  • Independent scaling capabilities
Cost Efficiency
  • Lower cost than App Service Premium
  • Right-sized for background workloads
  • Burstable performance tier
  • Shared infrastructure for multiple services
Operational Control
  • Full OS-level access and configuration
  • Custom service deployment options
  • Direct log file access
  • System-level monitoring and diagnostics
Deployment Process
  1. Infrastructure Provisioning: Pulumi creates VM, networking, and security groups
  2. OS Configuration: Ubuntu 20.04 setup with .NET 10 runtime installation
  3. Service Deployment: Console applications deployed via SSH/SCP
  4. Service Configuration: Systemd service files and environment configuration
  5. Monitoring Setup: Log aggregation and health check endpoints

Infrastructure as Code

Pulumi Configuration

The entire Azure infrastructure is defined and managed using Pulumi with C#:

Key Configuration Parameters:
  • Location: Central US
  • Resource Base Name: gmi
  • Environment: Development
  • Network Range: 10.0.0.0/16
Infrastructure as Code Benefits:
  • Version controlled infrastructure
  • Reproducible deployments
  • Automated provisioning
  • Environment consistency
  • Infrastructure documentation
  • Easy rollback capabilities
Cost Optimization
App Service Plans (2x S1) ~$150/month
MySQL Flexible (B1ms) ~$35/month
Virtual Machine (B2ms) ~$40/month
Storage Accounts ~$10/month
Network Resources ~$5/month
Total Estimated ~$240/month
Security Features
  • VNet Integration: All services in private network
  • Private MySQL: No public internet access
  • NSG Rules: Restricted SSH and service access
  • Azure AD: Enterprise authentication
  • Managed Identity: Secure service-to-service auth
Performance Specs
App Service Plans
S1 Standard
VM Configuration
2 vCPU, 8 GB RAM
MySQL Storage
20 GB SSD
Blob Storage Tier
Hot Access
Scalability
  • App Service: Auto-scaling rules configured
  • MySQL: Vertical scaling available
  • VM: Can resize or add instances
  • Functions: Consumption-based scaling
  • Storage: Unlimited capacity