Deployment Configuration - seojedaperez/IgnisMap GitHub Wiki

This document provides comprehensive information about the Azure cloud deployment configuration for the IgnisMap emergency response system, including automated provisioning, service architecture, and cost optimization strategies.

Overview

The IgnisMap system leverages eight core Azure services organized into critical and supporting tiers based on operational importance and cost impact 2 . The infrastructure is provisioned through automated shell scripts that create and configure all necessary resources in a single resource group 3 .

Service Architecture

Azure Services Overview

graph TB
    subgraph "Critical Services ($115-150/month)"
        AzureMaps["emergency-app-maps<br/>Azure Maps S1"]
        CosmosDB["emergency-app-cosmos<br/>Cosmos DB"]
        Functions["emergency-app-functions<br/>Function App"]
        OpenAI["emergency-openai<br/>Cognitive Services"]
    end
    
    subgraph "Supporting Services ($50-120/month)"
        EventHub["emergency-app-events<br/>Event Hubs"]
        CogServices["emergency-app-cognitive<br/>Cognitive Services"]
        KeyVault["emergency-app-vault<br/>Key Vault"]
        AppInsights["emergency-app-insights<br/>Application Insights"]
        Storage["emergencystorage<br/>Storage Account"]
    end
    
    subgraph "External Data Sources"
        NASA["NASA FIRMS API"]
        Weather["Open-Meteo API"]
    end
    
    AzureMaps --> Functions
    CosmosDB --> Functions
    Functions --> OpenAI
    Functions --> CogServices
    EventHub --> Functions
    KeyVault --> Functions
    KeyVault --> CosmosDB
    KeyVault --> AzureMaps
    Functions --> AppInsights
    Functions --> Storage
    
    NASA --> EventHub
    Weather --> Functions
Loading

Infrastructure Provisioning

Automated Deployment Workflow

flowchart TD
    Start["azure-setup.sh"] --> Login["az login verification"]
    Login --> ResourceGroup["Create emergency-rg<br/>Resource Group"]
    
    ResourceGroup --> Maps["Create emergency-app-maps<br/>S1 SKU"]
    Maps --> Cosmos["Create emergency-app-cosmos<br/>GlobalDocumentDB"]
    Cosmos --> Containers["Create 8 Cosmos containers<br/>Organizations, FireAlerts, etc."]
    
    Containers --> Storage["Create storage account<br/>Standard_LRS"]
    Storage --> Functions["Create emergency-app-functions<br/>Node.js 18, v4"]
    
    Functions --> Cognitive["Create emergency-app-cognitive<br/>CognitiveServices S0"]
    Cognitive --> EventHubs["Create emergency-app-events<br/>Standard SKU"]
    
    EventHubs --> KeyVault["Create emergency-app-vault<br/>Standard SKU"]
    KeyVault --> Secrets["Store connection strings<br/>and API keys"]
    
    Secrets --> Insights["Create emergency-app-insights<br/>Application Insights"]
    Insights --> Config["Configure Function App<br/>environment variables"]
    
    Config --> Output["Generate azure-config.json<br/>configuration file"]
Loading

The deployment process is handled by two main scripts: azure-setup.sh and setup-azure-emergency.sh 4 . These scripts automatically create all Azure resources with proper naming conventions following the pattern {APP_NAME}-{SERVICE_TYPE} where APP_NAME is "emergency-app" 5 .

Resource Configuration

Service Type Resource Name Purpose Cost Range
Maps emergency-app-maps Geospatial mapping services $50-80/month
Cosmos DB emergency-app-cosmos Global document database $25-40/month
Functions emergency-app-functions Serverless compute platform $10-20/month
Cognitive Services emergency-app-cognitive AI and ML services $30-50/month
Event Hubs emergency-app-events Real-time data streaming $30-50/month
Key Vault emergency-app-vault-{timestamp} Secrets management Included
App Insights emergency-app-insights Application monitoring $15-25/month
Storage emergencystorage{timestamp} File and blob storage $20-30/month

Data Storage Architecture

Cosmos DB Container Structure

graph TB
    subgraph "EmergencyDB Database"
        Orgs[Organizations<br/>Partition: /organizationType<br/>400 RU/s]
        Zones[MonitoringZones<br/>Partition: /organizationId<br/>400 RU/s]
        Alerts[FireAlerts<br/>Partition: /organizationId<br/>1000 RU/s]
        Plans[TacticalPlans<br/>Partition: /organizationType<br/>400 RU/s]
        Satellite[SatelliteData<br/>Partition: /satellite<br/>2000 RU/s<br/>TTL: 30 days]
        Weather[WeatherData<br/>Partition: /location<br/>800 RU/s<br/>TTL: 7 days]
        Resources[ResourceAllocation<br/>Partition: /organizationId<br/>400 RU/s]
        Audit[AuditLog<br/>Partition: /organizationId<br/>400 RU/s]
    end
    
    subgraph "Access Patterns"
        Orgs --> "Query by organization type"
        Zones --> "Query by organization ID"
        Alerts --> "Query by organization ID"
        Plans --> "Query by organization type"
        Satellite --> "Query by satellite source"
        Weather --> "Query by geographic region"
        Resources --> "Query by organization ID"
        Audit --> "Query by organization ID"
    end
Loading

The Cosmos DB deployment creates eight specialized containers with optimized throughput allocation 6 :

  • High-throughput containers: SatelliteData (2000 RU/s), FireAlerts (1000 RU/s), WeatherData (800 RU/s)
  • Standard-throughput containers: All others (400 RU/s)
  • TTL-enabled containers: SatelliteData (30 days), WeatherData (7 days)

Configuration Management

Environment Variables Setup

graph LR
    Script["Deployment Script"] --> EnvVars["Environment Variables"]
    EnvVars --> CosmosConn["COSMOS_CONNECTION_STRING"]
    EnvVars --> MapsKey["AZURE_MAPS_KEY"]
    EnvVars --> CogEndpoint["COGNITIVE_SERVICES_ENDPOINT"]
    EnvVars --> CogKey["COGNITIVE_SERVICES_KEY"]
    EnvVars --> InsightsKey["APPINSIGHTS_INSTRUMENTATIONKEY"]
    
    CosmosConn --> FunctionApp["Azure Function App"]
    MapsKey --> FunctionApp
    CogEndpoint --> FunctionApp
    CogKey --> FunctionApp
    InsightsKey --> FunctionApp
Loading

The Function App receives configuration through environment variables managed by the provisioning script 7 :

Variable Source Purpose
COSMOS_CONNECTION_STRING Cosmos DB primary connection string Database access
AZURE_MAPS_KEY Azure Maps primary key Geospatial services
COGNITIVE_SERVICES_ENDPOINT Cognitive Services endpoint URL AI service access
COGNITIVE_SERVICES_KEY Cognitive Services primary key AI service authentication
APPINSIGHTS_INSTRUMENTATIONKEY Application Insights key Telemetry collection

Key Vault Secret Management

graph LR
    KeyVault["emergency-app-vault"] --> CosmosSecret["CosmosConnectionString"]
    KeyVault --> MapsSecret["AzureMapsKey"]
    KeyVault --> CognitiveSecret["CognitiveServicesKey"]
    
    CosmosSecret --> CosmosDB["emergency-app-cosmos"]
    MapsSecret --> AzureMaps["emergency-app-maps"]
    CognitiveSecret --> CogServices["emergency-app-cognitive"]
Loading

Three critical secrets are stored in Key Vault for secure access 8 :

Event Processing Architecture

Event Hubs Configuration

sequenceDiagram
    participant NASA as "NASA FIRMS API"
    participant EventHub as "satellite-data Event Hub"
    participant Functions as "Azure Functions"
    participant Cosmos as "Cosmos DB"
    participant AI as "Cognitive Services"
    
    NASA->>EventHub: Satellite fire data
    EventHub->>Functions: ProcessSatelliteData trigger
    Functions->>AI: Analyze fire imagery
    Functions->>Cosmos: Store processed data
    Functions->>Functions: GenerateTacticalPlan
    Functions->>Cosmos: Store tactical plans
Loading

The Event Hubs namespace emergency-app-events contains the satellite-data event hub configured for high-throughput satellite data ingestion 9 :

  • Partition count: 4 partitions for parallel processing
  • Message retention: 7 days
  • SKU: Standard tier for production workloads

Deployment Process

Setup Script Execution

flowchart TD
    Prerequisites["Prerequisites Check<br/>• Azure CLI installed<br/>• Account with $1,000 credits<br/>• Contributor permissions"] --> Execute["Execute setup script"]
    Execute --> CreateRG["Create Resource Group<br/>emergency-rg"]
    CreateRG --> ProvisionServices["Provision Azure Services<br/>Maps, Cosmos, Functions, etc."]
    ProvisionServices --> ConfigureSecrets["Configure Key Vault Secrets"]
    ConfigureSecrets --> SetEnvVars["Set Function App Environment Variables"]
    SetEnvVars --> GenerateConfig["Generate azure-config.json"]
    GenerateConfig --> Complete["Deployment Complete<br/>Display connection strings"]
Loading

The deployment can be executed using the automated setup script 10 :

chmod +x scripts/setup-azure-emergency.sh
./scripts/setup-azure-emergency.sh

Cost Structure and Optimization

Monthly Cost Breakdown

pie title Monthly Azure Costs ($165-270 USD)
    "Azure Maps" : 50-80
    "Cosmos DB" : 25-40
    "Cognitive Services" : 30-50
    "Azure Functions" : 10-20
    "Event Hubs" : 30-50
    "Other Services" : 20-30
Loading

The Azure infrastructure operates with an estimated monthly cost of $165-270 USD 11 :

Service Category Cost Range Services Included
Critical Tier $115-150/month Azure Maps, Cosmos DB, Functions, OpenAI
Supporting Tier $50-120/month Cognitive Services, Event Hubs, Storage, Vault, Insights

Cost Optimization Strategies

The provisioning scripts implement several cost optimization measures 12 :

  • Cosmos DB: Session consistency level and optimized RU/s allocation per container
  • Storage: Standard_LRS redundancy for cost-effective local storage
  • Functions: Consumption plan for serverless cost scaling
  • TTL policies: Automatic data expiration for satellite and weather data

Monitoring and Observability

Application Insights Integration

graph TB
    subgraph "Monitoring Stack"
        AppInsights["Application Insights<br/>emergency-app-insights"]
        Metrics["Performance Metrics<br/>• Function execution times<br/>• Resource utilization"]
        Errors["Error Tracking<br/>• Exception logging<br/>• Failure analysis"]
        Custom["Custom Telemetry<br/>• Fire detection accuracy<br/>• Response time metrics"]
        Dependencies["Dependency Tracking<br/>• External API calls<br/>• Service health"]
    end
    
    AppInsights --> Metrics
    AppInsights --> Errors
    AppInsights --> Custom
    AppInsights --> Dependencies
Loading

Application Insights provides comprehensive monitoring 13 :

Key Performance Indicators

Metric Target Purpose
Alert response time < 30 seconds Emergency response effectiveness
Fire detection accuracy > 95% Prediction system reliability
System availability 99.9% Service continuity
Tactical plan generation < 2 minutes Operational readiness
Satellite data latency < 5 minutes Real-time monitoring capability

Configuration Output

After successful deployment, the script generates an azure-config.json file containing all service configurations 14 :

{
  "resourceGroup": "emergency-rg",
  "location": "West Europe",
  "services": {
    "azureMaps": {
      "name": "emergency-app-maps",
      "key": "..."
    },
    "cosmosDb": {
      "name": "emergency-app-cosmos",
      "connectionString": "..."
    },
    "cognitiveServices": {
      "name": "emergency-app-cognitive",
      "endpoint": "...",
      "key": "..."
    }
  }
}

Notes

The deployment configuration is specifically designed for the IgnisMap emergency response system and includes automated provisioning scripts that handle the complete Azure infrastructure setup. The system uses a microservices architecture with serverless functions for processing satellite data from NASA FIRMS API and generating tactical emergency response plans. All configuration is managed through environment variables and Azure Key Vault for security.

⚠️ **GitHub.com Fallback** ⚠️