Your application currently has separate modes which is actually a good design:
ExtensionAttributes.WorkerSvc.exe --service # ? Windows Service (scheduled jobs)
ExtensionAttributes.WorkerSvc.exe --web # ? Web Dashboard (monitoring)Run two instances of your application - this is the most robust approach:
# Install as Windows Service for scheduled jobs
ExtensionAttributes.WorkerSvc.exe --service- Service Name:
ExtensionAttributesWorkerSvc - Purpose: Scheduled extension attribute processing
- Runs: Background, automatic startup
- Jobs: Quartz.NET scheduled jobs based on
schedule.json
# Run web dashboard separately (or as another service)
ExtensionAttributes.WorkerSvc.exe --web- Purpose: Real-time monitoring, health checks, manual device processing
- Runs: Web server on http://localhost:5000
- Features: Dashboard, API, health checks, device processing
# Main service on default ports
ExtensionAttributes.WorkerSvc.exe --service# Web service on different port - modify appsettings.json:
{
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://localhost:5001"
}
}
}
}
# Then run:
ExtensionAttributes.WorkerSvc.exe --webCreate a simple batch script or PowerShell script to manage both:
@echo off
echo Starting Extension Attributes Automation...
echo Installing Windows Service...
ExtensionAttributes.WorkerSvc.exe --service
timeout /t 5
echo Starting Web Dashboard...
start "Web Dashboard" ExtensionAttributes.WorkerSvc.exe --web
echo.
echo ? Extension Attributes Automation is running:
echo ?? Service: Background processing (Windows Service)
echo ?? Dashboard: http://localhost:5000
echo.
pauseWrite-Host "Starting Extension Attributes Automation..." -ForegroundColor Green
Write-Host "Installing Windows Service..." -ForegroundColor Yellow
Start-Process -FilePath "ExtensionAttributes.WorkerSvc.exe" -ArgumentList "--service" -Wait
Start-Sleep -Seconds 5
Write-Host "Starting Web Dashboard..." -ForegroundColor Yellow
Start-Process -FilePath "ExtensionAttributes.WorkerSvc.exe" -ArgumentList "--web"
Write-Host ""
Write-Host "? Extension Attributes Automation is running:" -ForegroundColor Green
Write-Host "?? Service: Background processing (Windows Service)" -ForegroundColor Cyan
Write-Host "?? Dashboard: http://localhost:5000" -ForegroundColor Cyan
Write-Host ""- ?? Independent Scaling - Each can be scaled separately
- ??? Fault Isolation - Web dashboard issues don't affect background processing
- ?? Easier Maintenance - Can restart web dashboard without affecting service
- ?? Dedicated Resources - Each optimized for its specific purpose
- ?? Clear Separation - Background processing vs interactive monitoring
- ?? Development Friendly - Can test web dashboard without running service
- Load Balancing: Multiple web dashboard instances can point to same service
- High Availability: Service continues even if web dashboard is down
- Security: Web dashboard can run in DMZ while service stays internal
- Monitoring: Each instance can be monitored independently
cd ExtensionAttributes.Worker\bin\Release\net9.0
ExtensionAttributes.WorkerSvc.exe --service# In same directory or different server
ExtensionAttributes.WorkerSvc.exe --web- ? Check Windows Services:
services.msc?ExtensionAttributesWorkerSvc - ? Check Web Dashboard: http://localhost:5000
- ? Check Health: http://localhost:5000/health-ui
You now have the best of both worlds:
- ?? Reliable background service handling scheduled processing
- ?? Interactive web dashboard for monitoring and control
- ?? Complete separation of concerns
- ??? Enterprise-grade reliability
This approach is actually superior to a hybrid solution because it provides better fault tolerance, scalability, and maintainability! ??