Add Azure Front Door hosting integration#16137
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16137Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16137" |
e2cb59f to
fd6de75
Compare
|
/deployment-test |
|
🚀 Deployment tests starting on PR #16137... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
Add Aspire.Hosting.Azure.FrontDoor, a new hosting integration that provisions
Azure Front Door (Standard SKU) via Azure.Provisioning.Cdn. The integration
generates bicep for a CDN profile, endpoint, origin group, origins, and a
default route with HTTPS redirect and compression.
API:
builder.AddAzureFrontDoor("frontdoor")
.WithOrigin(api.GetEndpoint("https"));
WithOrigin accepts an EndpointReference and extracts the host property so
that the generated bicep receives the hostname (not the full URL).
- New project: src/Aspire.Hosting.Azure.FrontDoor
- Unit tests with Verify bicep snapshots
- Deployment E2E test (App Service + Front Door)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
f3975d6 to
4fd8c99
Compare
|
/deployment-test |
|
🚀 Deployment tests starting on PR #16137... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
Strip properties that match Azure ARM defaults: health probes, load balancing, cache configuration, enabledState, port/priority/weight on origins, patternsToMatch/supportedProtocols on routes. Keep only required properties and intentional security choices (HTTPS-only forwarding, HTTPS redirect). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The webfrontend (React/Node) resource was not getting a compute environment from App Service. Switching to Azure Container Apps which handles all resource types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/deployment-test |
|
🚀 Deployment tests starting on PR #16137... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
|
🚀 Deployment tests starting on PR #16137... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
|
/deployment-test |
|
🚀 Deployment tests starting on PR #16137... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
|
/deployment-test |
|
🚀 Deployment tests starting on PR #16137... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
There was a problem hiding this comment.
Pull request overview
Adds a new Aspire hosting integration for provisioning Azure Front Door (Standard) using Azure.Provisioning.Cdn, along with unit/snapshot tests and an end-to-end deployment test to validate the scenario.
Changes:
- Introduces new
Aspire.Hosting.Azure.FrontDoorproject withAddAzureFrontDoor(...)+WithOrigin(...)APIs and generated Bicep infrastructure. - Adds unit tests with verified Bicep snapshots for single/multiple origins and probe-path behavior.
- Adds an E2E deployment test that creates a template app, adds hosting packages, deploys, and verifies ACA + Front Door endpoints.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureFrontDoorTests.AddAzureFrontDoorWithMultipleOriginsGeneratesBicep.verified.bicep | New verified Bicep snapshot for multiple-origins Front Door output. |
| tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureFrontDoorTests.AddAzureFrontDoorWithAppServiceGeneratesBicep.verified.bicep | New verified Bicep snapshot for the single-origin scenario. |
| tests/Aspire.Hosting.Azure.Tests/AzureFrontDoorTests.cs | New unit tests validating annotations, outputs, probe-path selection, and Bicep generation. |
| tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj | Adds test-time project reference to the new Front Door hosting project. |
| tests/Aspire.Deployment.EndToEnd.Tests/FrontDoorDeploymentTests.cs | Adds E2E deployment validation for an ACA + Front Door scenario. |
| src/Aspire.Hosting.Azure.FrontDoor/README.md | New hosting integration README for Azure Front Door. |
| src/Aspire.Hosting.Azure.FrontDoor/AzureFrontDoorResource.cs | Defines the Front Door resource and exposes endpoint URL output references. |
| src/Aspire.Hosting.Azure.FrontDoor/AzureFrontDoorOriginAnnotation.cs | Internal annotation used to track configured origins. |
| src/Aspire.Hosting.Azure.FrontDoor/AzureFrontDoorExtensions.cs | Implements AddAzureFrontDoor/WithOrigin and the underlying provisioning model generation. |
| src/Aspire.Hosting.Azure.FrontDoor/Aspire.Hosting.Azure.FrontDoor.csproj | New package project with Azure.Provisioning.Cdn dependency and test visibility. |
| Directory.Packages.props | Adds central package version for Azure.Provisioning.Cdn. |
| Aspire.slnx | Includes the new project in the solution. |
|
/deployment-test |
|
🚀 Deployment tests starting on PR #16137... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
|
/deployment-test |
|
🚀 Deployment tests starting on PR #16137... This will deploy to real Azure infrastructure. Results will be posted here when complete. |
|
❌ Deployment E2E Tests failed — 27 passed, 4 failed, 0 cancelled View test results and recordings
|
Documentation Check ✅No documentation PR is required for this change. The
The existing docs on the
|
Description
Add Aspire.Hosting.Azure.FrontDoor, a new hosting integration that provisions Azure Front Door (Standard SKU) via Azure.Provisioning.Cdn. The integration generates bicep for a CDN profile, endpoint, origin group, origins, and a default route.
API:
builder.AddAzureFrontDoor("frontdoor")
.WithOrigin(api.GetEndpoint("https"));
WithOrigin accepts an IResourceWithEndpoints and extracts the host property so that the generated bicep receives the hostname (not the full URL).
Fixes #2497
Here's an example of using it for aspire.dev: https://github.com/microsoft/aspire.dev/compare/eerhardt/UseFrontDoor
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: