Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion src/frontend/src/content/docs/whats-new/aspire-13-6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<Tabs syncKey='aspire-lang'>
<TabItem id='typescript' label='TypeScript'>

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();
```

</TabItem>
<TabItem id='csharp' label='C#'>

```csharp title="AppHost.cs"
using Azure.Provisioning;
Expand All @@ -914,6 +953,9 @@ builder.AddAzureFrontDoor("frontdoor")
});
```

</TabItem>
</Tabs>

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.

<LearnMore>
Expand Down
Loading