Azure Architecture
Complete Azure cloud infrastructure powering the Grade My Investments platform, deployed via Pulumi Infrastructure as Code.
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;Azure Resource Diagram
gmi-dev-rg
Central US RegionVirtual Network (10.0.0.0/16)
Storage & External Services
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 subnetNetwork Security Group
gmi-dev-vm-nsg
SSH (22), HTTP (80), HTTPS (443) access rulesPublic IP Address
gmi-dev-report-vm-public-ip
Static IP for VM SSH accessCompute & Web Apps
App Service Plans
gmi-dev-asp & gmi-dev-function-asp
Standard S1 tier for VNet integration supportClient Web App
gmi-dev-webapp
Blazor Server application with Google OAuthAdmin Web App
gmi-dev-admin-webapp
Administrative interface with Azure ADTechnology Web App
gmi-dev-technology-webapp
This documentation platformAzure Functions
gmi-dev-functions
.NET 10 Isolated runtime with HTTP triggersVirtual Machine
gmi-dev-report-vm (Standard_B2ms)
Ubuntu 20.04, 2 vCPU, 8 GB RAM for console appsData & Storage
MySQL Flexible Server
gmi-dev-mysql (Standard_B1ms)
MySQL 8.0.21, 20 GB storage, VNet integratedFunction Storage Account
gmidvstorage
Standard_LRS for Azure Functions runtimeBlob Storage Account
gmidevblob
Hot tier for report files and documentsBackground 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.

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
- Infrastructure Provisioning: Pulumi creates VM, networking, and security groups
- OS Configuration: Ubuntu 20.04 setup with .NET 10 runtime installation
- Service Deployment: Console applications deployed via SSH/SCP
- Service Configuration: Systemd service files and environment configuration
- 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
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
Scalability
- App Service: Auto-scaling rules configured
- MySQL: Vertical scaling available
- VM: Can resize or add instances
- Functions: Consumption-based scaling
- Storage: Unlimited capacity