Problem
In the current Boilerplate.Server.AppHost/Program.cs, all infrastructure resources (Redis, SQL Server, PostgreSQL, MySQL, SQLite, Azure Storage, MAUI) are configured inline with Docker-specific container settings (WithDataVolume, WithRedisInsight, WithImage, etc.).
When a developer wants to switch from local Docker containers to real Azure managed services (e.g. for staging or production), they need to:
- Know which method to replace (e.g.
AddRedis → AddAzureManagedRedis)
- Know which Azure-specific packages to add
- Manually untangle Docker-specific configuration from Azure configuration
- Make the same change in multiple places
This friction makes the Docker → Azure transition error-prone and undiscoverable.
Expected Behavior
Resource configuration should be encapsulated in extension methods that use Azure-native hosting packages (Aspire.Hosting.Azure.Sql, Aspire.Hosting.Azure.PostgreSQL, Aspire.Hosting.Azure.Redis) wrapped with RunAsContainer() / RunAsEmulator() for local development.
To switch to an actual Azure managed service, the developer simply removes the RunAsContainer() call — no other code changes needed.
Program.cs becomes a clean, readable orchestration file with one-liner calls like:
var redisCache = builder.AddRedisCache();
var sqlDatabase = builder.AddSqlServer();
var postgresDatabase = builder.AddPostgreSQL();
Problem
In the current
Boilerplate.Server.AppHost/Program.cs, all infrastructure resources (Redis, SQL Server, PostgreSQL, MySQL, SQLite, Azure Storage, MAUI) are configured inline with Docker-specific container settings (WithDataVolume,WithRedisInsight,WithImage, etc.).When a developer wants to switch from local Docker containers to real Azure managed services (e.g. for staging or production), they need to:
AddRedis→AddAzureManagedRedis)This friction makes the Docker → Azure transition error-prone and undiscoverable.
Expected Behavior
Resource configuration should be encapsulated in extension methods that use Azure-native hosting packages (
Aspire.Hosting.Azure.Sql,Aspire.Hosting.Azure.PostgreSQL,Aspire.Hosting.Azure.Redis) wrapped withRunAsContainer()/RunAsEmulator()for local development.To switch to an actual Azure managed service, the developer simply removes the
RunAsContainer()call — no other code changes needed.Program.csbecomes a clean, readable orchestration file with one-liner calls like: