# Azure Deployment - Infrastructure Samenvatting ## Applicatie Overzicht **Zuyderland CMDB GUI** - Web applicatie voor classificatie en beheer van applicatiecomponenten in Jira Assets. ### Technologie Stack - **Backend**: Node.js 20 (Express, TypeScript) - **Frontend**: React 18 (Vite, TypeScript) - **Database**: SQLite (cache layer, ~20MB, geen backup nodig - sync vanuit Jira) - **Containerization**: Docker - **Authentication**: Jira OAuth 2.0 of Personal Access Token - **Gebruikers**: Max. 20 collega's --- ## Infrastructure Vereisten ### 1. Compute Resources **Aanbevolen: Azure App Service (Basic Tier)** - **App Service Plan**: B1 (1 vCPU, 1.75GB RAM) - **voldoende voor 20 gebruikers** - 2 Web Apps: Backend + Frontend (deel dezelfde App Service Plan) - **Kosten**: ~€15-25/maand - **Voordelen**: Eenvoudig, managed service, voldoende voor kleine teams **Alternatief: Azure Container Instances (ACI) - Als je containers prefereert** - 2 containers: Backend + Frontend - Backend: 1 vCPU, 2GB RAM - Frontend: 0.5 vCPU, 1GB RAM - **Kosten**: ~€30-50/maand - **Nadeel**: Minder managed features dan App Service ### 2. Database & Storage **Optie A: PostgreSQL (Aanbevolen) ⭐** - **Azure Database for PostgreSQL**: Flexible Server Basic tier (B1ms) - **Database**: ~20MB (huidige grootte, ruimte voor groei) - **Kosten**: ~€20-30/maand - **Voordelen**: Identieke dev/prod stack, betere concurrency, connection pooling **Optie B: SQLite (Huidige situatie)** - **SQLite Database**: ~20MB (in Azure Storage) - **Azure Storage Account**: Standard LRS (Hot tier) - **Kosten**: ~€1-3/maand - **Nadelen**: Beperkte concurrency, geen connection pooling **Logs**: ~500MB-1GB/maand (Application Insights) ### 3. Networking **Vereisten:** - **HTTPS**: SSL/TLS certificaat (Let's Encrypt of Azure App Service Certificate) - **DNS**: Subdomain (bijv. `cmdb.zuyderland.nl`) - **Firewall**: Inbound poorten 80/443, outbound naar Jira API - **Load Balancer**: Azure Application Gateway (optioneel, voor HA) **Network Security:** - Private endpoints (optioneel, voor extra security) - Network Security Groups (NSG) - Azure Firewall (optioneel) ### 4. Secrets Management **Azure Key Vault** voor: - `JIRA_OAUTH_CLIENT_SECRET` - `SESSION_SECRET` - `ANTHROPIC_API_KEY` - `JIRA_PAT` (indien gebruikt) **Kosten**: ~€1-5/maand ### 5. Monitoring & Logging **Azure Monitor:** - Application Insights (Basic tier - gratis tot 5GB/maand) - Log Analytics Workspace (Pay-as-you-go) - Alerts voor health checks, errors **Kosten**: ~€0-20/maand (met Basic tier vaak gratis voor kleine apps) ### 6. Backup & Disaster Recovery **Geen backup vereist** - Data wordt gesynchroniseerd vanuit Jira Assets, dus backup is niet nodig. De SQLite database is een cache layer die opnieuw opgebouwd kan worden via sync. --- ## Deployment Architectuur ### Aanbevolen: Azure App Service (Basic Tier) **Eenvoudige setup voor kleine teams (20 gebruikers):** ``` ┌─────────────────────────────────────┐ │ Azure App Service (B1 Plan) │ │ │ │ ┌──────────┐ ┌──────────┐ │ │ │ Frontend │ │ Backend │ │ │ │ Web App │ │ Web App │ │ │ └──────────┘ └────┬─────┘ │ └─────────────────────────┼──────────┘ │ ┌─────────────┴─────────────┐ │ │ ┌───────▼──────┐ ┌────────────▼────┐ │ Azure Storage│ │ Azure Key Vault │ │ (SQLite DB) │ │ (Secrets) │ └──────────────┘ └─────────────────┘ │ ┌───────▼──────┐ │ Application │ │ Insights │ │ (Basic/FREE) │ └──────────────┘ ``` **Opmerking**: Application Gateway is niet nodig voor 20 gebruikers - App Service heeft ingebouwde SSL en load balancing. --- ## Security Overwegingen ### 1. Authentication - **Jira OAuth 2.0**: Gebruikers authenticeren via Jira - **Session Management**: Sessions in-memory (overweeg Azure Redis Cache voor productie) ### 2. Network Security - **HTTPS Only**: Alle verkeer via HTTPS - **CORS**: Alleen toegestaan vanuit geconfigureerde frontend URL - **Rate Limiting**: 100 requests/minuut per IP (configureerbaar) ### 3. Data Security - **Secrets**: Alle secrets in Azure Key Vault - **Database**: SQLite database in Azure Storage (encrypted at rest) - **In Transit**: TLS 1.2+ voor alle communicatie ### 4. Compliance - **Logging**: Alle API calls gelogd (geen PII) - **Audit Trail**: Wijzigingen aan applicaties gelogd - **Data Residency**: Data blijft in Azure West Europe (of gewenste regio) --- ## Externe Dependencies ### 1. Jira Assets API - **Endpoint**: `https://jira.zuyderland.nl` - **Authentication**: OAuth 2.0 of Personal Access Token - **Rate Limits**: Respecteer Jira API rate limits - **Network**: Outbound HTTPS naar Jira (poort 443) ### 2. AI API (Optioneel) - **Anthropic Claude API**: Voor AI classificatie features - **Network**: Outbound HTTPS naar `api.anthropic.com` --- ## Deployment Stappen ### 1. Azure Resources Aanmaken ```bash # Resource Group az group create --name rg-cmdb-gui --location westeurope # App Service Plan (Basic B1 - voldoende voor 20 gebruikers) az appservice plan create --name plan-cmdb-gui --resource-group rg-cmdb-gui --sku B1 # Web Apps (delen dezelfde plan - kostenbesparend) az webapp create --name cmdb-backend --resource-group rg-cmdb-gui --plan plan-cmdb-gui az webapp create --name cmdb-frontend --resource-group rg-cmdb-gui --plan plan-cmdb-gui # Key Vault az keyvault create --name kv-cmdb-gui --resource-group rg-cmdb-gui --location westeurope # Storage Account (voor SQLite database - alleen bij SQLite optie) az storage account create --name stcmdbgui --resource-group rg-cmdb-gui --location westeurope --sku Standard_LRS ``` **Met PostgreSQL (Aanbevolen):** ```bash # PostgreSQL Database (Flexible Server) az postgres flexible-server create \ --resource-group rg-cmdb-gui \ --name psql-cmdb-gui \ --location westeurope \ --admin-user cmdbadmin \ --admin-password \ --sku-name Standard_B1ms \ --tier Burstable \ --storage-size 32 \ --version 15 # Database aanmaken az postgres flexible-server db create \ --resource-group rg-cmdb-gui \ --server-name psql-cmdb-gui \ --database-name cmdb ``` ### 2. Configuration - Environment variabelen via App Service Configuration - Secrets via Key Vault references - SSL certificaat via App Service Certificate of Let's Encrypt ### 3. CI/CD - **Azure DevOps Pipelines** of **GitHub Actions** - Automatische deployment bij push naar main branch - Deployment slots voor zero-downtime updates --- ## Kosten Schatting (Maandelijks) **Voor 20 gebruikers - Basic Setup:** **Met SQLite (huidige setup):** | Component | Schatting | |-----------|-----------| | App Service Plan (B1) | €15-25 | | Storage Account | €1-3 | | Key Vault | €1-2 | | Application Insights (Basic) | €0-5 | | **Totaal** | **€17-35/maand** | **Met PostgreSQL (aanbevolen):** | Component | Schatting | |-----------|-----------| | App Service Plan (B1) | €15-25 | | PostgreSQL Database (B1ms) | €20-30 | | Key Vault | €1-2 | | Application Insights (Basic) | €0-5 | | **Totaal** | **€36-62/maand** | *Inclusief: SSL certificaat (gratis via App Service), basis monitoring* **Opmerking**: Met Basic tier en gratis Application Insights kan dit zelfs onder €20/maand blijven. **Backup**: Niet nodig - data wordt gesynchroniseerd vanuit Jira Assets. --- ## Vragen voor Infrastructure Team 1. **DNS & Domain**: Kunnen we een subdomain krijgen? (bijv. `cmdb.zuyderland.nl`) 2. **SSL Certificaat**: Azure App Service Certificate of Let's Encrypt via certbot? 3. **Network**: Moeten we via VPN/ExpressRoute of direct internet toegang? 4. **Firewall Rules**: Welke outbound toegang is nodig? (Jira API, Anthropic API) 5. **Monitoring**: Gebruiken we bestaande Azure Monitor setup of aparte workspace? 6. **Backup**: Niet nodig - SQLite database is cache layer, data wordt gesynchroniseerd vanuit Jira Assets 7. **Disaster Recovery**: Data kan opnieuw gesynchroniseerd worden vanuit Jira (geen backup vereist) 8. **Compliance**: Zijn er specifieke compliance requirements? (ISO 27001, NEN 7510) 9. **Scaling**: Niet nodig - max. 20 gebruikers, Basic tier is voldoende 10. **Maintenance Windows**: Wanneer kunnen we updates deployen? --- ## Next Steps 1. **Kick-off Meeting**: Bespreken architectuur en requirements 2. **Proof of Concept**: Deploy naar Azure App Service (test environment) 3. **Security Review**: Security team review van configuratie 4. **Load Testing**: Testen onder verwachte load 5. **Production Deployment**: Go-live met monitoring --- ## Contact & Documentatie - **Application Code**: [Git Repository] - **Deployment Guide**: `PRODUCTION-DEPLOYMENT.md` - **API Documentation**: `/api/config` endpoint