Simplify Docker to Azure managed services switch in Aspire AppHost #12366#12368
Conversation
…Aspire AppHost bitfoundation#12366 - Add IDistributedApplicationBuilderExtensions with encapsulated resource methods (AddRedisCache, AddRedisPersistent, AddSqlServer, AddPostgreSQL, AddMySql, AddSqlite, AddAzureStorage, AddMaui) using Azure-native hosting packages wrapped with RunAsContainer()/RunAsEmulator() for local dev - Simplify Program.cs to clean one-liner calls; removing RunAsContainer() on any method is now sufficient to switch to the real Azure managed service - Replace Docker-only NuGet packages with Azure-capable equivalents: Aspire.Hosting.SqlServer -> Aspire.Hosting.Azure.Sql Aspire.Hosting.PostgreSQL -> Aspire.Hosting.Azure.PostgreSQL Aspire.Hosting.Redis + Aspire.Hosting.Azure.Redis (both referenced) - Bump Aspire package versions to 13.3.4, Magick.NET to 14.13.1 - Update AppHost SDK to 13.3.3 - Remove now-redundant 'Going Production' docs section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR refactors the Boilerplate template's AppHost infrastructure setup by extracting Docker/Azure provisioning logic into reusable extension methods. Dependencies are upgraded to 13.3.4, Program.cs is simplified from 89 lines of inline container config to clean one-liner calls, and outdated documentation is removed. The abstraction enables developers to switch between local Docker emulators and Azure managed services without rewriting infrastructure code. ChangesAspire Infrastructure Abstraction Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs`:
- Line 19: The template uses a mismatched database discriminator ("PostgreSql")
so the PostgreSQL setup (builder.AddPostgreSQL()) is skipped; update the
template conditional(s) that check the database discriminator to use the exact
token "PostgreSQL" (capital S and Q) so they align with other files, and verify
any occurrences of the discriminator string in related template conditionals and
resource wiring are normalized to "PostgreSQL" to ensure AddPostgreSQL() is
executed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a523c6d2-fab8-4f3c-8a1f-b59e37726b0a
📒 Files selected for processing (6)
src/Templates/Boilerplate/Bit.Boilerplate/.docs/20- .NET Aspire.mdsrc/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.propssrc/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Boilerplate.Server.AppHost.csprojsrc/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Infrastructure/Extensions/IDistributedApplicationBuilderExtensions.cssrc/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cssrc/Templates/Boilerplate/Bit.Boilerplate/src/Tests/Infrastructure/TestsAssemblyInitializer.cs
💤 Files with no reviewable changes (1)
- src/Templates/Boilerplate/Bit.Boilerplate/.docs/20- .NET Aspire.md
This closes #12366
Summary by CodeRabbit
New Features
Chores
Refactor