diff --git a/src/frontend/src/content/docs/whats-new/aspire-13-6.mdx b/src/frontend/src/content/docs/whats-new/aspire-13-6.mdx index 3fb714a0e..8a1c51884 100644 --- a/src/frontend/src/content/docs/whats-new/aspire-13-6.mdx +++ b/src/frontend/src/content/docs/whats-new/aspire-13-6.mdx @@ -892,7 +892,46 @@ Azure Front Door origin names generated by the Aspire hosting integration now co 2. Confirm that the newly named origins are healthy and serve the intended backends. 3. Manually delete the old origins from each affected origin group. -**Fallback:** If the recommended deployment and cleanup approach isn't feasible, preserve the previous default origin names by overriding them with `ConfigureInfrastructure` before the first deployment after upgrading: +**Fallback:** If the recommended deployment and cleanup approach isn't feasible, preserve the previous default origin names by overriding them in an infrastructure customization callback before the first deployment after upgrading: + + + + +Add the experimental CDN provisioning package to enable typed origin lookups: + +```bash title="Add CDN provisioning support" +aspire add Aspire.Hosting.Azure.Provisioning.Cdn +``` + +```typescript title="apphost.mts" twoslash +import { createBuilder } from './.aspire/modules/aspire.mjs'; + +const builder = await createBuilder(); +const api = await builder.addProject('api', '../Api/Api.csproj'); +await api.withExternalHttpEndpoints(); + +const frontdoor = await builder.addAzureFrontDoor('frontdoor'); +await frontdoor.withOrigin(api); +await frontdoor.configureInfrastructure(async (infrastructure) => { + const bicep = await infrastructure.bicep(); + const groupId = await bicep.member(await bicep.resourceGroup(), 'id'); + const suffix = await bicep.uniqueString([groupId]); + + for (const origin of await infrastructure.getFrontDoorOrigins()) { + // Match the previous default: remove underscores and hash only the resource-group ID. + const identifier = await origin.bicepIdentifier.get(); + const prefix = await bicep.string(`${identifier.replaceAll('_', '')}-`); + const name = await bicep.concat([prefix, suffix]); + // Front Door origin names have a maximum length of 90 characters. + await origin.name.set(await bicep.take(name, 90)); + } +}); + +await builder.build().run(); +``` + + + ```csharp title="AppHost.cs" using Azure.Provisioning; @@ -914,6 +953,9 @@ builder.AddAzureFrontDoor("frontdoor") }); ``` + + + The callback runs after the integration's defaults and applies to every configured origin. This override opts out of hostname-based origin identity, so switching backends no longer creates a new origin; if the new naming scheme has already been deployed, applying the override doesn't delete the newly created origins, so disable or remove unwanted origins separately after confirming which origins should serve traffic.