Deployment

Overview

The Event Sourcing Reference Platform is designed for deployment as a cloud-native application on Microsoft Azure using fully managed Platform as a Service (PaaS) offerings.

The deployment architecture emphasises:


Deployment Architecture

Azure Deployment Diagram


Azure Resources

Resource Purpose
Azure App Service Hosts the ASP.NET Core Web API
Azure App Service Hosts the Angular web application
Azure Function Processes projection events
Azure Cosmos DB Event Store
Azure SQL Database Read model projections
Azure Service Bus Topics Event distribution
Azure Blob Storage Static assets and future archival
Microsoft Entra ID Authentication
Application Insights Telemetry
Log Analytics Centralised logging

Infrastructure as Code

All Azure resources are provisioned using Bicep.

Infrastructure definitions are stored alongside the application source code and deployed automatically through Azure DevOps pipelines.

Benefits include:

Example deployment structure:

infra/

├── main.bicep
├── appservice.bicep
├── cosmoscontainer.bicep
├── servicebus.bicep
├── storage-account.bicep

Continuous Integration

Every commit triggers an automated build pipeline.

Pipeline stages include:

  1. Restore NuGet packages
  2. Compile solution
  3. Execute unit tests
  4. Run static code analysis
  5. Publish build artefacts

The objective is to ensure every commit produces a deployable application.


Continuous Deployment

Successful builds are deployed automatically using Azure DevOps.

Typical deployment flow:

Git Commit
      │
      ▼
Azure DevOps
      │
      ▼
Build
      │
      ▼
Unit Tests
      │
      ▼
Publish Artefacts
      │
      ▼
Provision Infrastructure
      │
      ▼
Deploy Application
      │
      ▼
Health Checks

Environment Strategy

Separate Azure environments are maintained for each deployment stage.

Environment Purpose
Development Feature development
Test Integration testing
Production Live demonstration environment

Each environment is deployed using the same Infrastructure as Code templates.


Application Configuration

Configuration is externalised from the application.

Examples include:

Future enhancements include Azure App Configuration and Azure Key Vault integration.


Security

Deployment follows Azure security best practices.

Security measures include:


Observability

Production monitoring is provided through Azure Monitor services.

Monitoring includes:

Application Insights provides operational visibility across all deployed components.


Scaling

The architecture allows independent scaling of application components.

Examples include:

Because processing is asynchronous, read and write workloads can be scaled independently.


Resilience

The deployment architecture has been designed to support resilient operation.

Examples include:

Future enhancements include geo-redundancy and disaster recovery.


Local Development

Developers can run the solution locally using:

Infrastructure definitions remain identical between local and cloud environments wherever practical.


Future Enhancements

Planned deployment improvements include: