Events¶
Target Architecture — Final-State Design
All messages travel in the canonical event envelope on Azure Service Bus via MassTransit. Commands are VerbNoun (intent); domain and integration events are NounVerbPastTense (facts), per the naming conventions.
The Runtime & Cloud Platform is event-driven end to end. Lifecycle commands enter from the Control Plane and DevOps; domain events record every runtime state change; integration events promote selected facts to a cross-platform contract consumed by Observability, Governance, and the Control Plane.
Commands¶
| Command | Handler | Effect |
|---|---|---|
ProvisionEnvironment |
RuntimeEnvironmentService | Plan and apply Pulumi to stand up a RuntimeEnvironment |
Deploy |
DeploymentService | Roll generated workloads onto Azure compute |
RollbackDeployment |
DeploymentService | Revert to the last good RuntimeDeployment |
PublishConfiguration |
RuntimeConfigurationService | Version and publish a RuntimeConfiguration |
BindSecret |
SecretBindingService | Create a Key Vault-backed SecretBinding |
RotateSecret |
SecretBindingService | Rotate a bound secret via managed identity |
BindTenant |
TenantRuntimeIsolationService | Create/update a RuntimeTenantBinding |
ApplyScalingPolicy |
RuntimeScalingService | Apply a ScalingPolicy to a running service |
RemediateDrift |
DeploymentService | Issue a corrective deployment for a drift finding |
Domain Events¶
| Event | Producer | Meaning |
|---|---|---|
RuntimeEnvironmentProvisioned |
RuntimeEnvironmentService | An environment was successfully provisioned on Azure |
RuntimeDeploymentCompleted |
DeploymentService | A deployment rolled out and passed health gates |
ConfigurationSynced |
RuntimeConfigurationService | A configuration version was applied to a workload |
SecretRotated |
SecretBindingService | A bound secret was rotated to a new Key Vault version |
HealthCheckCompleted |
RuntimeHealthService | A health evaluation produced a HealthCheckResult |
ScalingPolicyApplied |
RuntimeScalingService | A scaling action changed replica/throughput targets |
RuntimeDriftDetected |
RuntimeDriftDetectionService | Actual state diverged from desired state |
RuntimeTenantBound |
TenantRuntimeIsolationService | A tenant was bound to a runtime environment with an isolation model |
Integration Events¶
The following domain events are promoted to versioned cross-platform integration events (see the Event Catalog):
RuntimeEnvironmentProvisioned→ consumed by Control Plane (lifecycle gating) and Governance (isolation audit).RuntimeDeploymentCompleted→ consumed by Control Plane (workflow progression), Observability (deploy markers), and the Knowledge Platform (runtime lineage).HealthCheckCompletedandRuntimeDriftDetected→ consumed by Observability & Feedback for SLO tracking and incident creation.SecretRotated→ consumed by Governance for secret-lifecycle audit.
Canonical Envelope¶
All events use the canonical envelope. Example RuntimeDeploymentCompleted:
{
"eventId": "evt-3a6e1d40-2e44-4c1a-9b6d-0f2a8c3d5e10",
"eventType": "RuntimeDeploymentCompleted",
"tenantId": "connectsoft",
"projectId": "proj-booking-saas",
"moduleId": "module-reservations-api",
"traceId": "trace-9f1c2b7d",
"correlationId": "corr-3a6e1d40",
"causationId": "evt-deploy-requested-id",
"occurredAt": "2026-06-11T18:02:00Z",
"payload": {
"deploymentId": "dep-3a6e1d40",
"environmentId": "env-9f1c2b7d",
"target": "aks",
"image": "acr.azurecr.io/reservations-api:1.4.2",
"previousImage": "acr.azurecr.io/reservations-api:1.4.1",
"healthGate": "Passed",
"strategy": "RollingHealthGated"
}
}
Azure Service Bus Topics¶
Events are published to per-context topics; consumers subscribe with rules filtering on cs-event-type and cs-tenant-id application properties.
| Topic | Events | Primary Subscribers |
|---|---|---|
runtime.environment |
RuntimeEnvironmentProvisioned, RuntimeTenantBound |
Control Plane, Governance, ServiceCatalogRuntimeService |
runtime.deployment |
RuntimeDeploymentCompleted |
Control Plane, Observability, RuntimeInventoryWorker, DriftDetectionWorker |
runtime.configuration |
ConfigurationSynced |
DeploymentService, Observability |
runtime.secrets |
SecretRotated |
Governance, DeploymentService |
runtime.health |
HealthCheckCompleted |
ScalingPolicyWorker, DriftDetectionWorker, Observability |
runtime.scaling |
ScalingPolicyApplied |
Observability, RuntimeInventoryWorker |
runtime.drift |
RuntimeDriftDetected |
DeploymentService, Observability, Governance |
Event-Flow Diagram¶
flowchart LR
Provision["ProvisionEnvironment"] --> EnvProv["RuntimeEnvironmentProvisioned"]
EnvProv --> Deploy["Deploy"]
Bind["BindTenant"] --> TenantBound["RuntimeTenantBound"]
Publish["PublishConfiguration"] --> CfgSync["ConfigurationSynced"]
CfgSync --> Deploy
Deploy --> DepDone["RuntimeDeploymentCompleted"]
DepDone --> Health["HealthCheckCompleted"]
Health --> Scaled["ScalingPolicyApplied"]
Health --> Drift["RuntimeDriftDetected"]
Scaled --> Drift
Drift -->|"RemediateDrift"| Deploy
Rotate["RotateSecret"] --> SecRot["SecretRotated"]
SecRot --> Deploy