Environments
Satélite API supports multiple deployment environments with distinct configurations for production operations and development testing.Available Environments
Satélite API maintains two primary deployment environments:Production
Environment:
ProductionURL: https://sateliteappapi.azurewebsites.netPurpose: Live production operations with real business dataCharacteristics:- High availability configuration
- Auto-scaling enabled
- Production database connections
- Enhanced security and monitoring
- Minimal logging for performance
Testing
Environment:
QualityURL: https://sateliteappapi-test.azurewebsites.netPurpose: Development, testing, and QA validationCharacteristics:- Test database connections
- Detailed logging enabled
- Rapid deployment cycles
- Isolated from production data
- Lower resource allocation
Environment Configuration
The active environment is controlled by theASPNETCORE_ENVIRONMENT variable, which determines which configuration files are loaded and how the application behaves.
Setting the Environment
Environment Values
Production Environment
Production Environment
Value:
ProductionUsed for:- Production Azure Web App (sateliteappapi.azurewebsites.net)
- Live customer-facing operations
- Real business data processing
appsettings.Production.jsonlaunchSettings.json:12-21
Quality (Testing) Environment
Quality (Testing) Environment
Value:
QualityUsed for:- Testing Azure Web App (sateliteappapi-test.azurewebsites.net)
- QA and UAT testing
- Development validation
appsettings.Quality.jsonlaunchSettings.json:22-29
Development Environment
Development Environment
Value:
DevelopmentUsed for:- Local development on developer machines
- Debugging and development features enabled
- Detailed error pages and diagnostics
appsettings.Development.jsonDevelopment environment is not deployed to Azure. It’s only for local development.
Environment-Specific Settings
Configuration File Structure
Configuration is loaded in this order:Example Configuration Structure
Database Connections by Environment
Each environment connects to separate database instances to maintain data isolation:- Production
- Testing (Quality)
Connection Strings: Point to production SQL Server instances
SateliteConnection→ Production Satélite DBCajachicaConnection→ Production Cajachica DBAnticiposConnection→ Production Anticipos DBNexusConnection→ Production Nexus DB- And all other production databases…
BitacoraCumplimientoDBContext and NexusDBContextProgram.cs:274-280
Switching Between Environments
For Azure Deployment
Update App Setting
Change
ASPNETCORE_ENVIRONMENT in Azure Portal:- Navigate to Web App > Configuration
- Under Application settings, find
ASPNETCORE_ENVIRONMENT - Change value to desired environment (
ProductionorQuality) - Click Save
Update Connection Strings
Verify connection strings point to correct databases:
- Go to Configuration > Connection strings
- Update each connection string to target correct database
- Click Save
For Local Development
- Visual Studio
- Command Line
- dotnet run
- Open
Properties/launchSettings.json - Locate the profile you want to use
- Change
ASPNETCORE_ENVIRONMENTvalue - Save and restart debugger
Environment-Specific Behaviors
Logging Levels
Production
Minimal Logging
- Errors and Critical only
- Reduced console output
- Performance optimized
- Log to Application Insights
Testing
Detailed Logging
- Information and Debug levels
- Verbose console output
- Request/response logging
- Easier troubleshooting
GraphQL Features
Both environments share the same GraphQL configuration:- 10-minute execution timeout
- Automatic persisted queries disabled in production
- Introspection enabled in testing
- GraphQL playground available in testing only
Scheduled Jobs
Scheduled jobs run in both environments but with different schedules:- Production Schedule
- Testing Schedule
Security Considerations
Production Security
Production Security
- Enable Azure AD authentication
- Use Azure Key Vault for all secrets
- Restrict CORS to specific origins
- Enable Application Insights security monitoring
- Configure Web Application Firewall (WAF)
- Regular security audits and penetration testing
Testing Security
Testing Security
- Use separate service principals
- Limit access to test data only
- Allow broader CORS for development
- Use non-production API credentials
- Regular cleanup of test data
Best Practices
Always Test First
Deploy and test all changes in the Quality environment before promoting to Production
Monitor Both Environments
Set up Application Insights for both Production and Quality to catch issues early
Environment Health Checks
Verify environment is correctly configured:Troubleshooting
Wrong database being accessed
Wrong database being accessed
Symptom: Application connects to incorrect databaseSolution:
- Verify
ASPNETCORE_ENVIRONMENTis set correctly - Check connection strings in Azure Portal
- Ensure configuration file naming matches environment exactly
- Restart the application after changes
Environment variable not taking effect
Environment variable not taking effect
Symptom: Changes to environment variables don’t applySolution:
- Verify the variable is set in correct location (Azure App Settings)
- Click Save in Azure Portal after changes
- Restart the Web App
- Check logs to confirm environment is loaded correctly
Configuration conflicts
Configuration conflicts
Symptom: Unexpected configuration valuesSolution:
Remember configuration priority order:
- Environment variables (highest)
- Azure App Settings
- appsettings..json
- appsettings.json (lowest)
Next Steps
Azure Setup
Learn how to deploy to Azure Web Services
Configuration
Configure connection strings and application settings