Aspire + enterprise Azure naming standard + DTAP-aware topology - what's the idiomatic pattern? #16830
Replies: 1 comment
|
Kieron (@kieronlanning), a great question which makes me think 😀 Since we have to keep the But For |
|
Kieron (@kieronlanning), a great question which makes me think 😀 Since we have to keep the But For |
Uh oh!
There was an error while loading. Please reload this page.
Hey all 👋 — looking for the community's view on the cleanest Aspire-native way to handle two intertwined requirements. Bicep-by-hand works, but I'd rather lean on the AppHost as the single source of truth if I can.
The setup
I'm building an Aspire AppHost targeting Azure, deploying via
aspire deploy, but I have two constraints from the platform team:1. Custom Azure resource naming
We have an enforced enterprise naming standard — Azure Policy will reject anything that doesn't match. The shape is roughly:
Concrete examples:
Notes that make this awkward:
<resource-prefix>is org-defined, not the Azure CAF abbreviations Aspire defaults to (e.g. we usestrnotstfor storage).<division>and<environment>need to be injected from outside the AppHost - CI/CD vars for example based on the deployment pipeline's targetted environment.2. DTAP environments with diverging topologies
Standard DTAP — Dev, Test, Acceptance, Prod — but the topology genuinely differs, not just SKU sizes:
So Acceptance/Prod aren't just "Dev with bigger numbers" — they have additional resources (secondary SQL server, secondary storage, Traffic Manager / Front Door for failover) that simply don't exist in Dev/Test.
What I've looked at
ConfigureInfrastructurelets me reach into the generated Bicep and rename / re-SKU resources per call. Works, but if I have 15 resources it's 15 lambdas full of string interpolation, and I'd rather centralise.AddParameter) for SKUs work fine for scalar differences, but don't help when the resource graph itself differs between environments.builder.ExecutionContext.IsPublishMode+ a customEnvironmentparameter — feels like the right axis but I haven't seen a clean idiom for "only add this resource in Acceptance/Prod".Questions
ConfigureInfrastructure? Something like anIAzureResourceNamerI could register once?if (env is "acc" or "prod") builder.AddAzureSqlServer(...).WithGeoReplica(...)actually the way, or is there a more declarative shape people use?AddParameter+ Bicep@alloweddecorators, separateappsettings.{env}.jsonconsumed in the AppHost,azdenv vars, or something else? What's held up best in practice?WithAnnotationeverywhere?ConfigureInfrastructurecalls.Bonus: if anyone has a public sample repo doing real DTAP with Aspire (not just
devvsprod), I'd love a link 🙏Thanks!
All reactions