Use Case 020: Multi-Environment Configuration Deployment
Overview
| Property | Value |
|---|---|
| Use Case ID | UC-020 |
| Use Case Name | Multi-Environment Configuration Deployment |
| Module | Configuration Management - Environment Orchestration |
| Priority | High |
| Status | Implemented |
| Version | 1.0 |
| Last Updated | February 23, 2026 |
Description
This use case describes how Application Manager enables administrators and DevOps teams to manage configuration files across multiple environments (development, staging, beta, production) with clear separation, environment-specific overrides, and controlled promotion workflows. Users can create environment-specific configurations, promote validated configurations from lower to higher environments, compare configuration differences across environments, and deploy changes without container rebuilds—all while maintaining strict access controls and comprehensive audit trails.
Actors
| Actor | Description | Role |
|---|---|---|
| DevOps Engineer | Engineer managing application deployments | Primary |
| Developer | Developer testing configurations in dev/staging | Primary |
| Administrator | Admin with production configuration access | Primary |
| System | Application Manager platform | Supporting |
| Application | Riptide application consuming configurations | Supporting |
| CI/CD Pipeline | Automated deployment system | Secondary |
Preconditions
- Application Manager is running and accessible
- User authenticated with appropriate environment permissions
- At least one application registered with environment support
- Environment structure defined (dev, staging, beta, production)
- Base configuration files exist in development environment
- User has environment-specific capabilities (e.g.,
config:deploy:production)
Postconditions
Success Postconditions
- Configuration files created/updated in target environment
- Environment-specific overrides applied correctly
- Configuration validation passed for target environment
- Deployment history recorded with environment context
- Applications in target environment fetch updated configurations
- Changes logged in audit trail with environment information
- Notifications sent to relevant stakeholders
Failure Postconditions
- Configuration deployment rejected if validation fails
- Rollback initiated for failed deployments
- Error details logged with environment context
- Alerts sent to administrators
- Previous configuration remains active
Triggers
- Developer creates/modifies configuration in development environment
- DevOps engineer promotes configuration from staging to production
- CI/CD pipeline deploys environment-specific configuration
- Administrator compares configurations across environments
- Application service restart in specific environment triggers config fetch
- Scheduled deployment automation runs
- Emergency rollback initiated in production
Basic Flow (Happy Path - Configuration Promotion)
Alternative Flows
Alt-1: Environment-Specific Override
Trigger: Configuration needs different values per environment
Flow:
Developer creates base configuration in development:
{ "Database": { "ConnectionString": "{{DB_CONNECTION}}", "MaxPoolSize": 100 }, "Logging": { "Level": "Debug" } }DevOps creates environment overrides:
- Development:
LogLevel: Debug, small pool size - Staging:
LogLevel: Information, medium pool size - Production:
LogLevel: Warning, large pool size, connection string from secret
- Development:
System merges base config with environment-specific overrides
Applications fetch environment-appropriate configuration
Variables like
{{DB_CONNECTION}}resolved from environment secrets
Alt-2: Configuration Diff and Comparison
Trigger: DevOps wants to compare staging vs production configs
Flow:
- DevOps selects "Compare Environments"
- UI prompts for source and target environments
- DevOps selects "Staging" vs "Production"
- API fetches configurations from both environments
- System performs file-by-file comparison
- UI displays side-by-side diff:
- Files only in staging (green)
- Files only in production (red)
- Files with differences (yellow)
- Identical files (grey)
- DevOps can drill down to line-by-line differences
- DevOps can promote individual files or bulk promote
Alt-3: Automated Promotion (CI/CD Integration)
Trigger: CI/CD pipeline deploys application to staging
Flow:
- CI/CD pipeline builds application
- Pipeline calls Configuration Manager API:
POST /api/v1/config/promote -H "Authorization: Bearer $CI_TOKEN" -d '{"sourceEnv": "dev", "targetEnv": "staging", "applicationId": "app-1"}' - API validates CI token has promotion permission
- API promotes all configurations for application
- API returns promotion summary (files updated, validation results)
- Pipeline continues with deployment
- Pipeline confirms configurations applied
Alt-4: Production Deployment with Approval
Trigger: DevOps promotes configuration to production
Flow:
- DevOps initiates promotion to production
- System detects production requires approval
- API creates pending deployment request
- System sends notification to production approvers
- Approver reviews deployment request:
- Configuration diff
- Deployment notes
- Risk assessment
- Previous deployment history
- Approver approves or rejects request
- If approved, deployment proceeds automatically
- If rejected, requester notified with rejection reason
Alt-5: Failed Production Deployment Rollback
Trigger: Deployed configuration causes application errors
Flow:
- Application in production applies new configuration
- Application health checks start failing
- Monitoring system detects degraded health
- Alert sent to on-call engineer
- Engineer reviews recent configuration changes
- Engineer initiates emergency rollback:
POST /api/v1/config/rollback {"environment": "production", "fileId": "...", "version": "v1"} - System immediately reverts to previous version
- Application fetches rolled-back configuration
- Application health restored
- Incident logged for post-mortem
Business Rules
Environment Hierarchy Rules
- BR-020-01: Environments ordered: Development < Staging < Beta < Production
- BR-020-02: Configurations can only be promoted up the hierarchy (dev → staging → beta → prod)
- BR-020-03: Demotion (prod → staging) requires explicit
config:demotepermission - BR-020-04: Cross-environment comparisons allowed for all authenticated users
Permission Rules
- BR-020-05: Development access: All developers have read/write access
- BR-020-06: Staging deployment: Requires
config:deploy:stagingcapability - BR-020-07: Production deployment: Requires
config:deploy:productioncapability - BR-020-08: Production deployment approval: Configurable (optional or required)
- BR-020-09: Emergency production rollback: Requires
config:rollback:production
Validation Rules
- BR-020-10: All configurations validated before deployment
- BR-020-11: Environment-specific validation rules enforced (e.g., prod requires encryption)
- BR-020-12: Production configurations must not contain "localhost" or "127.0.0.1"
- BR-020-13: Secret placeholders (e.g.,
{{DB_PASSWORD}}) resolved from environment secrets - BR-020-14: Schema validation failures block deployment
Version Control Rules
- BR-020-15: Each environment maintains independent version history
- BR-020-16: Promotions create new version in target environment
- BR-020-17: Rollback possible to any previous version within retention period
- BR-020-18: Version retention: Development (3 versions), Staging (5), Production (10)
Data Requirements
Environment Entity
| Field | Type | Constraints | Description |
|---|---|---|---|
Id |
Guid | Primary Key | Unique environment ID |
Name |
string(50) | Required, Unique | Environment name |
DisplayName |
string(100) | Required | User-friendly name |
Tier |
enum | Required | Development, Staging, Beta, Production |
Order |
int | Required | Promotion order (1-4) |
RequiresApproval |
bool | Required | Deployment approval required |
IsActive |
bool | Required | Environment enabled |
Color |
string(7) | Required | UI color code (hex) |
Description |
string(500) | Optional | Environment purpose |
ConfigurationFile Entity (Extended)
| Field | Type | Constraints | Description |
|---|---|---|---|
EnvironmentId |
Guid | Required, FK | Environment this config belongs to |
PromotedFrom |
Guid | Nullable, FK | Source environment if promoted |
PromotedBy |
Guid | Nullable, FK | User who promoted |
PromotedAt |
DateTimeOffset | Nullable | Promotion timestamp |
PromotionNotes |
string(1000) | Optional | Deployment notes |
LastRetrievedAt |
DateTimeOffset | Nullable | Last fetch by application |
LastRetrievedBy |
string(100) | Optional | Application instance ID |
EnvironmentOverride Entity
| Field | Type | Constraints | Description |
|---|---|---|---|
Id |
Guid | Primary Key | Unique override ID |
ApplicationId |
Guid | Required, FK | Target application |
EnvironmentId |
Guid | Required, FK | Environment |
VariableName |
string(100) | Required | Variable name (e.g., DB_CONNECTION) |
VariableValue |
string(2000) | Encrypted | Environment-specific value |
IsSecret |
bool | Required | Encrypt value in logs |
User Interface
Environment Selector
┌─────────────────────────────────────────┐
│ Environment: [Staging ▼] │
├─────────────────────────────────────────┤
│ • Development (18 configs) │
│ • Staging ← You are here │
│ • Beta (15 configs) │
│ • Production (15 configs) 🔒 │
└─────────────────────────────────────────┘
Configuration Promotion Dialog
┌──────────────────────────────────────────────────┐
│ Promote Configuration to Production │
├──────────────────────────────────────────────────┤
│ File: appsettings.json │
│ Source: Staging (v3) │
│ Target: Production (currently v2) │
│ │
│ Configuration Diff: │
│ ┌──────────────────────────────────────────────┐ │
│ │ "Database": { │ │
│ │ - "ConnectionString": "Server=staging-db" │ │
│ │ + "ConnectionString": "Server=prod-db" │ │
│ │ "MaxPoolSize": 100 │ │
│ │ }, │ │
│ │ "Logging": { │ │
│ │ - "Level": "Information" │ │
│ │ + "Level": "Warning" │ │
│ │ } │ │
│ └──────────────────────────────────────────────┘ │
│ │
│ Deployment Notes (Required): │
│ ┌──────────────────────────────────────────────┐ │
│ │ Deploy latest database connection string │ │
│ │ and reduce logging verbosity for production │ │
│ └──────────────────────────────────────────────┘ │
│ │
│ ⚠️ This deployment requires approval. │
│ │
│ [Cancel] [Submit for Approval]│
└──────────────────────────────────────────────────┘
Environment Comparison View
┌────────────────────────────────────────────────────────┐
│ Compare: [Staging ▼] vs [Production ▼] [Refresh] │
├────────────────────────────────────────────────────────┤
│ File Staging Production │
├────────────────────────────────────────────────────────┤
│ 🟢 appsettings.json v3 (newer) v2 │
│ 🟡 database.json v2 (diff) v2 (diff) │
│ ⚪ logging.json v1 v1 │
│ 🔴 experimental.json v1 (missing) │
├────────────────────────────────────────────────────────┤
│ Legend: │
│ 🟢 Newer in source 🟡 Different ⚪ Identical 🔴 Missing│
│ │
│ [Promote All Differences] [Promote Selected] │
└────────────────────────────────────────────────────────┘
API Endpoints
List Environments
Endpoint: GET /api/v1/config/environments
Response: 200 OK
{
"environments": [
{"id": "env-1", "name": "development", "displayName": "Development", "tier": "Development", "order": 1, "color": "#28a745"},
{"id": "env-2", "name": "staging", "displayName": "Staging", "tier": "Staging", "order": 2, "color": "#ffc107"},
{"id": "env-3", "name": "beta", "displayName": "Beta", "tier": "Beta", "order": 3, "color": "#17a2b8"},
{"id": "env-4", "name": "production", "displayName": "Production", "tier": "Production", "order": 4, "color": "#dc3545"}
]
}
Promote Configuration
Endpoint: POST /api/v1/config/promote
Request Body:
{
"sourceEnvironmentId": "env-2",
"targetEnvironmentId": "env-4",
"fileId": "550e8400-e29b-41d4-a716-446655440000",
"deploymentNotes": "Deploy optimized database connection pool settings",
"validateOnly": false
}
Response: 200 OK
{
"promotionId": "660e8400-e29b-41d4-a716-446655440099",
"status": "AwaitingApproval",
"sourceEnvironment": "staging",
"targetEnvironment": "production",
"fileId": "550e8400-e29b-41d4-a716-446655440000",
"fileName": "appsettings.json",
"validationResult": {
"valid": true,
"warnings": [],
"errors": []
},
"requiresApproval": true,
"estimatedApprovalTime": "2026-02-24T10:00:00Z"
}
Compare Environments
Endpoint: GET /api/v1/config/compare?source={envId}&target={envId}
Response: 200 OK
{
"sourceEnvironment": "staging",
"targetEnvironment": "production",
"differences": [
{
"filePath": "/appsettings.json",
"status": "SourceNewer",
"sourceVersion": "v3",
"targetVersion": "v2",
"lastModified": "2026-02-23T10:00:00Z"
},
{
"filePath": "/database.json",
"status": "Different",
"sourceVersion": "v2",
"targetVersion": "v2",
"contentHash": "different"
}
],
"summary": {
"totalFiles": 15,
"identical": 11,
"different": 2,
"sourceOnly": 1,
"targetOnly": 1
}
}
Rollback Configuration
Endpoint: POST /api/v1/config/rollback
Request Body:
{
"environmentId": "env-4",
"fileId": "550e8400-e29b-41d4-a716-446655440000",
"targetVersion": "v2",
"reason": "New configuration causing high error rates"
}
Response: 200 OK
{
"rollbackId": "770e8400-e29b-41d4-a716-446655440088",
"environment": "production",
"fileName": "appsettings.json",
"rolledBackFrom": "v3",
"rolledBackTo": "v2",
"rolledBackBy": "jane@example.com",
"timestamp": "2026-02-23T11:15:00Z"
}
Performance Requirements
- PR-020-01: Environment listing completed within 200ms
- PR-020-02: Configuration promotion completed within 3 seconds
- PR-020-03: Environment comparison for 100 files completed within 2 seconds
- PR-020-04: Configuration rollback completed within 1 second
- PR-020-05: Application configuration fetch completed within 500ms
Security Considerations
Access Control
- Environment-specific permissions enforced (dev, staging, production)
- Production deployment requires elevated privileges
- Audit trail for all cross-environment operations
- RBAC enforced at environment level
Secret Management
- Environment variables encrypted at rest (AES-256)
- Secret placeholders resolved only at application runtime
- Secrets never logged in plain text
- Production secrets accessible only to production deploy role
Change Management
- Production deployments optionally require approval
- Emergency rollback capability for production incidents
- All promotions logged with user identity and timestamp
- Deployment notes required for production changes
Testing Scenarios
Test Case TC-020-01: Configuration Promotion
Steps:
- Developer creates configuration in development
- Configuration validated and deployed to dev
- DevOps promotes to staging
- DevOps tests in staging
- DevOps promotes to production (with approval)
- Approver reviews and approves
- Configuration deployed to production
Expected Results:
- Configuration successfully promoted through all environments
- Version history maintained per environment
- Audit trail shows promotion chain
- Applications in each environment fetch correct version
Test Case TC-020-02: Environment Comparison
Steps:
- DevOps compares staging vs production
- System generates diff report
- DevOps reviews differences
Expected Results:
- Diff accurately shows configuration differences
- Files categorized correctly (identical, different, missing)
- Side-by-side comparison available
Test Case TC-020-03: Emergency Rollback
Steps:
- Production deployment causes issues
- Engineer identifies problem configuration
- Engineer initiates rollback to v2
- System immediately reverts configuration
Expected Results:
- Rollback completed within 1 second
- Applications fetch rolled-back version
- Rollback logged in audit trail
- Alert sent to team
Monitoring and Analytics
Metrics
- config.promotion.count: Promotions per environment
- config.promotion.duration: Promotion completion time
- config.rollback.count: Rollback frequency per environment
- config.deployment.failure: Failed deployment count
- config.approval.duration: Time from request to approval
Alerts
- High rollback rate: > 10% deployments rolled back in 7 days
- Pending approvals: Approval pending > 24 hours
- Deployment failures: > 3 failures in 1 hour
Related Use Cases
- UC-007: Configuration File Management - Base configuration operations
- UC-008: Configuration Version Control and Rollback - Version management
- UC-010: Activity Logging and Audit Trail - Deployment logging
- UC-006: Role-Based Access Control - Environment permissions
Notes and Assumptions
Assumptions
- Applications support environment-aware configuration fetching
- Environment secrets managed securely
- Approval workflows configured per organization policy
Implementation Notes
- Support for configuration templates with environment variable substitution
- Consider GitOps integration for configuration as code
- Implement canary deployments for phased production rollouts
Revision History
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0 | 2026-02-23 | System | Initial use case documentation |