Automating Azure Container Apps custom domains with OctoDNS + aspire do #18945
zortracks
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Automating Azure Container Apps custom domains with OctoDNS +
aspire doTL;DR
I built a NuGet hosting package that wires custom domains for Azure Container Apps into the Aspire deploy pipeline. It handles DNS through OctoDNS (config generated in-process, sync in Docker), then managed certificates (inventory → create → bind) — all as named
aspire dosteps that sit aroundaspire deploy.📦
Neox.Aspire.Hosting.Azure.CustomDomains📂 Source: neox-technology/aspire
The problem I kept hitting
ConfigureCustomDomainon ACA is a great start, but getting a real hostname live still meant a lot of manual glue for me:A+asuidTXT)I wanted that whole flow to feel like the rest of Aspire — discoverable with
aspire do --list-steps, runnable interactively or in CI, and required byaspire deploywhen domains are in the model.What I built
Calling
WithAzureCustomDomainOpson a compute resource registers a DomainOps pipeline. Same DNS zone across multiple apps shares one zone plan/provision pair. Multiple hostnames on one app get distinct steps with serialized ARM PATCHes.DNS providers are source-generated from the OctoDNS catalogue (Cloudflare, OVH, Route53, Azure DNS, …), so the fluent API stays aligned with official
octodns/*images.Pipeline steps (in order)
Here’s the full chain. You can list it anytime with
aspire do --list-steps. Zone / hostname slugs replace.with-(e.g.example.com→example-com).1. Prerequisites
prereq-domainprovision-{acaEnv})prereq-domain-{provider}docker pullfor that provider’s OctoDNS image (e.g.octodns/cloudflare)2. DNS plan & provision (per provider / per zone)
plan-domain-{provider}octodns.yamlin-process (auth only asenv/VARrefs — never raw secrets)plan-domain-{zone}A+asuidTXT). Depends on provider plan and the Container Apps for that zone being provisionedprovision-domain-{zone}Apps that share a zone share these zone steps — I didn’t want every hostname to re-sync the same zone.
3. Hostname on the Container App (no cert yet)
plan-{resource}-domain-{dom}provision-{resource}-domain-{dom}provision-{env}-domains4. Managed certificates
plan-{env}-certificatesprovision-{env}-certificates5. Bind & deploy gate
deploy-{resource}-domain-{dom}deploy-domainsdeploy, so a normalaspire deploywaits for domains to finishBootstrap vs steady-state is intentional:
aspire deploywith an empty certificate parameter (Bicep can deploy without the cert name yet)Parameters__{resource}-certificate(or your explicit cert param) setIn CI I pass
Parameters__*/Azure__*and use--non-interactive. Locally, unresolved parameters open Aspire’s Set parameter modal.AppHost sketch
ARM goes through
ITokenCredentialProvider— DomainOps does not shell out toaz. Docker is only needed for OctoDNS sync.Design choices I care about
ConfigureCustomDomain— I don’t replace it; consumers still own that callAto the ACA env static IP +asuidTXT; don’t orange-cloud proxy during issuance/renewalLinks
I’d love feedback from anyone who’s already wrestled with ACA custom domains — especially on the bootstrap/redeploy loop, multi-hostname apps, and whether something like this belongs closer to upstream hosting.
All reactions