You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Azure Front Door Private Link support for Azure Container Apps - #21228
Adds WithAzureFrontDoorPrivateLink so an AppHost can opt in to reaching an Azure Container Apps environment through an Azure Front Door Private Link. When the Private Link is established, public network access on the Container Apps environment is disabled, the same way it is when a compute resource has a private endpoint to another Azure resource such as a storage account (PrivateEndpointTargetAnnotation).
Container Apps environment: publicNetworkAccess: 'Disabled', and the environment now always emits an AZURE_CONTAINER_APPS_ENVIRONMENT_LOCATION output with its other well-known outputs, including for existing environments, so the existing environment snapshots gain that one line.
Front Door: every origin that runs in the connected environment becomes a Private Link origin. The profile switches to Premium_AzureFrontDoor, the origin gets a sharedPrivateLinkResource that targets the environment (group managedEnvironments) with enforceCertificateNameCheck, and Front Door routes forward over HTTPS only, as they already did. Origins in other compute environments are left alone. The call can be made before or after WithOrigin; the conversion happens when the Front Door module is generated.
Same-environment references: unchanged. Apps in the environment keep calling each other through their ingress host names, and Container Apps documents that such calls stay inside the environment. This has not been verified against a deployed environment that has public network access disabled.
Private endpoint location: the environment's region, or the supported region of the same Azure geography when Front Door Private Link isn't available there (for example westus2 for westus). The environment module's AZURE_CONTAINER_APPS_ENVIRONMENT_LOCATION output is the programmatic name (toLower(replace(env.location, ' ', '')), because a managed environment returns a display name such as West US 2). Because that region is only known at deployment, the Front Door module declares a Bicep privateLinkRegions map of the 29 regions that need a remap and looks the environment's region up in it, keeping the region when it isn't listed. The map never crosses a geography, so data residency doesn't change; for the regions whose geography has no supported region (for example Switzerland North) it passes the region through, and deployment fails in Front Door. To use a different region, set the origin's SharedPrivateLinkResource.PrivateLinkLocation in ConfigureInfrastructure on the Front Door, for example from a parameter (shown in the Front Door README and covered by a test). The map has to be kept in sync with the Front Door Private Link regions.
Approval: Front Door creates the connection request as Pending. The environment owner approves it in the portal or with az network private-endpoint-connection approve; this is documented in the XML docs and the Front Door README. There is no automatic approval.
Publish fails with an actionable message when the environment is an Express or existing environment, when a connected Front Door has no origin in the environment, or when a Front Door that isn't connected has an origin in the locked-down environment.
Run mode is a no-op.
Notes for reviewers
WithAzureFrontDoorPrivateLink<T> is generic over a new IAzureCdnPrivateLinkTarget interface in Aspire.Hosting.Azure (named for the general technology, since Front Door is a Microsoft.Cdn profile; a compute environment that is itself the Azure resource a CDN profile's managed private endpoint connects to: its resource ID output, region output, and Private Link group ID). AzureContainerAppEnvironmentResource implements it explicitly, so there is no new public surface on the Container Apps type. Aspire.Hosting.Azure.FrontDoor does not reference Aspire.Hosting.Azure.AppContainers, and there is no new InternalsVisibleTo. App Service and AKS can implement the interface later.
The new APIs are [Experimental("ASPIREAZURE003")] like the other private networking APIs. The extension is exported for polyglot AppHosts as withAzureFrontDoorPrivateLink(frontDoor), following the WithDelegatedSubnet<T> precedent for generic exports.
The Front Door signals the target with the existing PrivateEndpointTargetAnnotation, so the Container Apps module disables public network access the same way other resources do for a private endpoint.
Intentionally not included: automatic in-deployment approval of the connection request, and a clear deployment-time error for regions without a supported Private Link region in their geography.
Validation
dotnet test --project tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true": passed (2104 total, 2099 succeeded, 5 skipped), including 20 new test cases in AzureFrontDoorPrivateLinkTests (one uses a non-Container Apps target to cover the interface, one overrides the location with ConfigureInfrastructure, and two cover the region map) and the existing Front Door snapshots unchanged (the Container Apps environment snapshots only gain the location output). The generated Front Door module also compiles with bicep build (0.46.1).
The generated Front Door, environment and container app Bicep compiles with bicep build (Bicep CLI 0.46.1); only the usual unused-parameter linter warnings.
Tested with the PR dogfood CLI: aspire publish on a starter app with two external origins generates the expected Bicep, aspire start runs normally locally, and an Express environment, an unconnected Front Door, and a connected Front Door with no origin each fail at publish with a clear message.
Not run: an end-to-end deployment to Azure (including approving the connection request and verifying traffic through Front Door).
Checklist
Is this feature complete?
Yes. Ready to ship.
No. Follow-up changes expected.
Are you including unit tests for the changes and scenario tests if relevant?
Yes
No
Did you add public API?
Yes
If yes, did you have an API Review for it?
Yes
No
Did you add <remarks /> and <code /> elements on your triple slash comments?
Yes
No
No
Does the change make any security assumptions or guarantees?
Yes
If yes, have you done a threat model and had a security review?
Add WithAzureFrontDoorPrivateLink on the Azure Container Apps environment builder.
It connects an Azure Front Door to the environment over Private Link and disables
public network access on the environment, as the existing private endpoint support
does for other Azure resources.
When publishing, every Front Door origin that runs in the connected environment
becomes a Private Link origin: the profile uses the Premium SKU, the origin gets a
sharedPrivateLinkResource that targets the environment (group managedEnvironments),
and Front Door forwards and probes over HTTPS. The private endpoint is placed in the
environment's region unless a location is supplied.
Container Apps changes:
- The environment is the target of a PrivateEndpointTargetAnnotation, so its module
sets publicNetworkAccess to Disabled and outputs its location. Express and existing
environments are rejected.
- References between apps in the same environment resolve to the environment-internal
host name, because the public host name refuses connections once public network
access is disabled.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: b19e4dfd-ceb6-4ee8-9be9-4329662dc918
Make WithAzureFrontDoorPrivateLink generic over a new
IAzureFrontDoorPrivateLinkTarget interface in Aspire.Hosting.Azure, instead of
taking an Azure Container Apps environment. The Container Apps environment
implements the interface explicitly, so Aspire.Hosting.Azure.FrontDoor no longer
references Aspire.Hosting.Azure.AppContainers and AppContainers no longer grants
InternalsVisibleTo to FrontDoor. Other compute environments, such as App Service
and AKS, can implement the interface later.
The request message and error messages now refer to the compute environment
generically. A test with a non-Container Apps target covers the interface.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: b19e4dfd-ceb6-4ee8-9be9-4329662dc918
Disabling public network access on the environment does not change an app's ingress hostname. These apps still use external: true, but this branch changes their service-discovery and endpoint-property references to api.internal.<domain>, the hostname form for internal ingress. This can break same-environment calls. Azure documents that same-environment calls to the app's configured FQDN stay inside the environment (details). Keep hostname selection based on external, and update the affected test, snapshot, and documentation to match.
Add end-to-end tests for Front Door connectivity and isolation
The new tests validate annotations and generated Bicep, not deployed connectivity or isolation. FrontDoorDeploymentTests deploys public origins and explicitly skips Front Door HTTP checks, so it cannot catch unreachable Private Link origins or broken same-environment references. Add a deployment end-to-end scenario that approves the pending connection, verifies HTTPS traffic through Front Door and a same-environment service reference, and confirms direct public access is blocked. Bicep compilation alone cannot verify these guarantees.
Front Door is a Microsoft.Cdn profile, so name the interface after the general
technology rather than one product. The WithAzureFrontDoorPrivateLink extension
keeps its name because it takes an Azure Front Door resource.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: b19e4dfd-ceb6-4ee8-9be9-4329662dc918
This disables public access for the entire environment, but the new tests only inspect generated Bicep. The existing FrontDoorDeploymentTests uses public origins and explicitly skips Front Door HTTP checks, so it cannot verify Private Link routing or isolation. Add a deployment end-to-end scenario that approves the pending connections, verifies requests through Front Door and between apps succeed, and confirms direct public access is blocked. Snapshot tests and Bicep compilation cannot establish these networking guarantees.
…teLink
The private endpoint is created in the environment's region. To use another
region, set the origin's SharedPrivateLinkResource.PrivateLinkLocation in
ConfigureInfrastructure on the Front Door, for example from a parameter. The
README and XML docs describe this, and a test covers it.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: b19e4dfd-ceb6-4ee8-9be9-4329662dc918
Please add a deployment end-to-end scenario for Private Link. The new tests validate generated Bicep and model behavior, while FrontDoorDeploymentTests uses public origins and explicitly skips Front Door HTTP checks. Neither verifies that the private deployment is reachable or blocks public access. Deploy two apps, approve the pending connection request(s), verify a request through Front Door and a same-environment service call, and confirm direct public access is blocked. Snapshot tests and Bicep compilation cannot validate these routing and access restrictions.
Cover the case where one Front Door has origins in more than one Container Apps
environment. Each environment gets its own resource ID, region and request
message, and origins in the same environment share one set of settings.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: b19e4dfd-ceb6-4ee8-9be9-4329662dc918
… in the same geography
Front Door Private Link is only available in some regions. Instead of failing at deployment when a
Container Apps environment is in another region, the Front Door module now creates the private endpoint
in the supported region of the same Azure geography, for example westus2 for westus. Regions in a
geography with no supported region are used as they are, and the ConfigureInfrastructure override
still applies.
The map is a Bicep variable because the environment's region is a deployed output.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: b19e4dfd-ceb6-4ee8-9be9-4329662dc918
Installed Version:17.0.0-pr.21228.g38c6fd40 (dogfood CLI + PR hive packages from CI run 39806749731)
Status: ✅ Verified
Changes Analyzed
Hosting: Aspire.Hosting.Azure.AppContainers (environment implements new IAzureCdnPrivateLinkTarget, new AZURE_CONTAINER_APPS_ENVIRONMENT_LOCATION output, publicNetworkAccess: Disabled, Express/existing guards), Aspire.Hosting.Azure.FrontDoor (WithAzureFrontDoorPrivateLink, Private Link origins, Premium SKU, region remap table), Aspire.Hosting.Azure (new interface).
Tests/snapshots: new AzureFrontDoorPrivateLinkTests + bicep snapshots; existing ACA snapshots gain the location output.
Not applicable: CLI, Dashboard, templates, client components, extension, CI infra.
Test Scenarios Executed
No Azure deployment was performed (needs a subscription and manual approval of the Pending connection). Validation uses aspire publish output from the PR-built packages plus an offline az bicep build (v0.41.2).
Scenario 1: Happy path publish (env + Front Door, 2 private origins + 1 origin in a second, unconnected env)
Coverage: Happy path / boundary — ✅ Passed
frontdoor.bicep: sku: Premium_AzureFrontDoor; api and web origins have sharedPrivateLinkResource (privateLink.id: env_environment_id, groupId: 'managedEnvironments', request message Azure Front Door frontdoor requests access to env., privateLinkLocation: (privateLinkRegions[?env_location] ?? env_location)), enforceCertificateNameCheck: true; privateLinkRegions var declared once.
other origin (in pubenv) has no private-link config (stays public).
env.bicep: publicNetworkAccess: 'Disabled'; pubenv.bicep has none. Both emit AZURE_CONTAINER_APPS_ENVIRONMENT_LOCATION = toLower(replace(<env>.location, ' ', '')).
main.bicep wires env_environment_id and env_location from env outputs. az bicep build main.bicep exit 0 (only pre-existing unused-param lint warnings).
Scenario 2: One Front Door → two Container Apps environments
Coverage: Happy path — ✅ Passed
Both environments publicNetworkAccess: 'Disabled'; one origin per env with its own <env>_environment_id/<env>_location params and per-env request message; Premium SKU; az bicep build exit 0.
Setup note: first attempt hit the pre-existing duplicate-env-name guard (needs WithUniqueResourceNaming()); not a PR issue.
Scenario 3: Run mode is a no-op
Coverage: Boundary — ✅ Passed
aspire start with the same model: container api Running/Healthy, endpoint returned HTTP 200, aspire stop clean. No private-link effects locally.
Scenario 4: Unhappy paths (all aspire publish, each failed with a clear, actionable message, exit code 6)
Case
Result
AsExisting env + private link
✅ "…marked as existing but is also the target of a private link… Remove the private link or stop marking the environment as existing."
AsExpress env + private link
✅ "Azure Container Apps Express environment 'env' cannot be the target of a private link…"
Front Door connected to env with no origin in it
✅ "…none of its origins run in that environment. Add apps … with WithOrigin, or remove the WithAzureFrontDoorPrivateLink call."
Second Front Door with an origin in the connected env
✅ "Origin 'api' of Azure Front Door 'fd2' … Call WithAzureFrontDoorPrivateLink on 'env' with 'fd2' to connect it."
Real Azure deployment: actual Private Link connection creation, Pending→Approved flow, traffic through Front Door, and acceptance of privateLinkRegions[?x] ?? x by ARM beyond Bicep compilation.
Observation (non-blocking): the new validation errors surface from aspire publish as an unhandled AggregateException stack trace (exit 6), the same path used by existing validations such as the duplicate-environment-name check.
Overall Result
✅ PR VERIFIED (publish-level; live Azure deployment not exercised)
Show the builder, the usings and the experimental diagnostic suppression that the Private Link samples
need, and turn the location override into a full AppHost. Both C# samples were compiled against the
PR packages, and the override sample was published to confirm it produces the parameterized location.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: b19e4dfd-ceb6-4ee8-9be9-4329662dc918
Added a "Private Link to Azure Container Apps" section to azure-front-door.mdx. Triggered signals: experimental_attribute_added (ASPIREAZURE003 on AzureFrontDoorPrivateLinkExtensions.cs), integration_readme_changed (FrontDoor README), new_public_type (IAzureCdnPrivateLinkTarget), pr_body_has_cli_flag_mention.
## Description
Follow-up to #21228: App Service workloads can now be private origins
behind Azure Front Door using the same `WithAzureFrontDoorPrivateLink`
API.
Each App Service origin targets its own `Microsoft.Web/sites` resource
(`sites` group), rather than the shared App Service plan. The opt-in
disables public network access on every workload website in the
environment and selects Front Door Premium. Existing plans are
supported; deployment slots are supported by targeting the production
site, since Front Door Private Link cannot target a slot; the slot has
public access disabled and is swapped into production. Aspire creates
the production site only if it does not exist, so enabling Private Link
on an existing public site does not disable its public access; disable
it on the site yourself. The separately provisioned dashboard is
unchanged.
The new, unreleased experimental `IAzureCdnPrivateLinkTarget` contract
from #21228 now resolves resource ID and region outputs per origin.
Container Apps continues to share its environment target. App Service
maintains stable website resource identities during dependency
discovery, and the deployment graph provisions websites before Front
Door. Published infrastructure exposes separately published website
outputs as explicit inputs instead of referencing modules absent from
`main.bicep`.
Fixes # (issue)
### User-facing usage
C#:
```csharp
#pragma warning disable ASPIREAZURE003
var environment = builder.AddAzureAppServiceEnvironment("env").WithDashboard(false);
var frontDoor = builder.AddAzureFrontDoor("frontdoor");
environment.WithAzureFrontDoorPrivateLink(frontDoor);
var api = builder.AddProject<Projects.Api>("api").WithExternalHttpEndpoints();
frontDoor.WithOrigin(api);
#pragma warning restore ASPIREAZURE003
```
TypeScript (verified against generated SDK signatures):
```typescript
const environment = await builder.addAzureAppServiceEnvironment("env").withDashboard(false);
const frontDoor = await builder.addAzureFrontDoor("frontdoor");
await environment.withAzureFrontDoorPrivateLink(frontDoor);
const api = await builder.addProject("api", "../Api/Api.csproj")
.withExternalHttpEndpoints();
await frontDoor.withOrigin(api);
```
After deployment, the resource owner must approve Front Door's pending
managed private endpoint connection on **each website**:
```bash
az network private-endpoint-connection list --type Microsoft.Web/sites --name <website-name> --resource-group <resource-group>
az network private-endpoint-connection approve --id <connection-id>
```
App Service does not provide Container Apps-style environment-local
ingress. `WithReference` still resolves to website hostnames, so
service-to-service callers need Front Door URLs or their own private
networking/DNS. Passing Front Door outputs back to its own origins
creates a deployment cycle; configure those URLs separately after
deployment.
### Validation
- `.\restore.cmd` — passed.
- `dotnet test --project
tests\Aspire.Hosting.Azure.Tests\Aspire.Hosting.Azure.Tests.csproj
--no-launch-profile -- --filter-class "*.AzureFrontDoorTests"
--filter-class "*.AzureFrontDoorPrivateLinkTests" --filter-class
"*.AzureFrontDoorAppServicePrivateLinkTests" --filter-class
"*.AzureEnvironmentResourceTests" --filter-class
"*.AzureAppServiceTests" --filter-not-trait "quarantined=true"
--filter-not-trait "outerloop=true"` — **117 passed**.
- `dotnet test --project
tests\Aspire.Hosting.Azure.Tests\Aspire.Hosting.Azure.Tests.csproj
--no-launch-profile -- --filter-not-trait "quarantined=true"
--filter-not-trait "outerloop=true"` — **2,118 passed, 5 skipped, 1
failed**. The failure was the unrelated storage emulator startup test
below.
- `dotnet test --project
tests\Aspire.Hosting.Azure.Tests\Aspire.Hosting.Azure.Tests.csproj
--no-launch-profile -- --filter-method
"*.AzureStorageEmulator_WithPersistentLifetime_ReusesContainersAndPorts"
--filter-not-trait "quarantined=true" --filter-not-trait
"outerloop=true"` — **1 passed** on isolated retry.
- `aspire publish --apphost
playground\FrontDoorPrivateLinkSmoke\Smoke.AppHost\Smoke.AppHost.csproj
--output-path <scratch>\publish --non-interactive` — passed using a
temporary two-origin AppHost with source project references.
- `az bicep build --file <published-file> --stdout` — passed for all
**six** generated Bicep artifacts.
- `Set-Location playground\FrontDoorPrivateLinkSmoke\TypeScript; dotnet
run --project ..\..\..\src\Aspire.Cli\Aspire.Cli.csproj
--no-launch-profile -- restore --non-interactive` — SDK generation
succeeded; confirmed `withAzureFrontDoorPrivateLink` on the generated
App Service resource and fluent promise. npm reported the intentionally
absent temporary `package.json`; this was a generated API surface check,
not a TypeScript runtime test.
- `git diff --check` — passed.
### Live Azure deployment
Deployed in `westus3` using the requested tenant's only subscription,
with two distinct App Service websites and Front Door Premium:
```powershell
aspire deploy --apphost playground\FrontDoorPrivateLinkSmoke\Smoke.AppHost\Smoke.AppHost.csproj --output-path <scratch>\deploy --non-interactive --include-exception-details
```
Result: **27/27 deployment steps succeeded**. Both managed private
endpoint connections were approved; both websites are running with
`publicNetworkAccess: Disabled`.
Verified at **2026-10-29 17:01:43 UTC**, after Front Door propagation:
| Origin | Public network access | Direct website HTTPS | Front Door
HTTPS |
| --- | --- | --- | --- |
| `api-ryygo2c7mutbk.azurewebsites.net` | Disabled | 403 |
[200](https://apiEndpoint-ryygo2c7mutbk-bahrfuchffe3ecbr.z01.azurefd.net/)
|
| `web-ryygo2c7mutbk.azurewebsites.net` | Disabled | 403 |
[200](https://webEndpoint-ryygo2c7mutbk-g0ekdueaacaxcncc.z01.azurefd.net/)
|
Both Front Door responses contained exactly
`aspire-appservice-private-link-ok`. Both website private endpoint
connections were `Approved`. Test resources are retained in
`rg-aspire-appservice-private-20261029` for inspection and continue to
incur Azure charges.
### Security considerations
This is an opt-in ingress restriction. It disables public access on all
workload websites, not only registered origins. Front Door uses
website-specific Private Link targets, the website host header, HTTPS
origin forwarding, and certificate-name validation. Managed private
endpoint requests require explicit approval by the resource owner. The
dashboard is separate and is not locked down by this feature; use
`WithDashboard(false)` when it is not needed. No automatic approval or
service-to-service networking is introduced. Security review is still
needed for the network-isolation guarantees.
## Checklist
- Is this feature complete?
- [x] Yes. Ready to ship.
- [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
- [x] Yes
- [ ] No
- Did you add public API?
- [x] Yes
- If yes, did you have an API Review for it?
- [ ] Yes
- [x] No
- Did you add `<remarks />` and `<code />` elements on your triple slash
comments?
- [x] Yes
- [ ] No
- [ ] No
- Does the change make any security assumptions or guarantees?
- [x] Yes
- If yes, have you done a threat model and had a security review?
- [ ] Yes
- [x] No
- [ ] No
---------
Co-authored-by: Copilot App <[email protected]>
…App Service (#2084)
## Summary
Documents `WithAzureFrontDoorPrivateLink`
(`withAzureFrontDoorPrivateLink` in TypeScript) for Azure Container Apps
and Azure App Service in Aspire 17.0. This consolidates the two bot
drafts, #1965 (Container Apps) and #2062 (App Service), into one set of
docs and supersedes both. The source changes are microsoft/aspire#21228
and microsoft/aspire#21396, and the final code and README on
`release/17.0` are identical to `main` for the affected files.
What changed:
- `azure-front-door.mdx`: new **Private Link origins** section with
requirements and SKU constraints, a complete TypeScript and C# example
for each target, what Aspire provisions (with a generated Bicep
excerpt), App Service publish/deploy behavior, deployment slots,
existing sites, service-to-service limits, connection approval commands
for both targets, the private endpoint region mapping and override
(TypeScript and C#), and a troubleshooting table. The frontmatter
description now mentions private origins.
- Short cross-links from the App Service host page, the Configure
Container Apps page, the two Azure deployment pages, and the Azure
security best practices page. The security page no longer says App
Service can only be a public website model.
- `ASPIREAZURE003` diagnostic page: notes that
`WithAzureFrontDoorPrivateLink` reports the diagnostic and adds an
example.
Decisions and assumptions:
- Examples use `AddDotnetProject` / `addDotnetProject`, because
`AddProject` is marked obsolete on `release/17.0`. The new section notes
the `Aspire.Hosting.Dotnet` package requirement.
- The TypeScript App Service example uses `withDashboard({ enable: false
})`. The `withDashboard(false)` form in the source PR description is a
type error against the generated SDK. Existing pages
(`deployment/azure/app-service.mdx`,
`deployment/azure/container-apps.mdx`) still show
`withDashboard(false)`; I left those alone because they are unrelated to
this change.
- The region override sets a literal region in both languages. The C#
parameter-based variant from the Front Door README was left out to keep
the TypeScript and C# samples equivalent. TypeScript needs the opt-in,
experimental `Aspire.Hosting.Azure.Provisioning.Cdn` package.
- App Service plan tiers that support private endpoints come from Azure
docs, not from the source PRs. The default Aspire plan (`P0V3`)
qualifies.
- No `ApiReference` links for the new APIs, because the generated API
data in this repo (13.6) does not contain them yet.
- Did not edit the 17.0 what's-new page, per the task scope.
Not verified and flagged in the docs where relevant:
- Same-environment Container Apps calls when public network access is
disabled. The source PR says this was not verified against a deployed
environment, so the docs tell readers to verify after the first
deployment.
- An end-to-end Container Apps deployment. Source PR #21396 deployed App
Service end to end (27 steps, direct URL returned 403, Front Door
returned 200). Source PR #21228 did not run an end-to-end deployment.
## Third-party links and affiliations
None. The added links point to Microsoft Learn and to NuGet.org package
pages for Aspire packages.
## Validation
- `pnpm install --frozen-lockfile` (from `src/frontend`): passed.
- `pnpm exec vitest run --config vitest.config.ts
tests/unit/seo-lengths.vitest.test.ts
tests/unit/api-reference-components.vitest.test.ts
tests/unit/typescript-first-apphost-tabs.vitest.test.ts`: passed (3
files, 8 tests).
- `pnpm test:unit:twoslash-blocks`: passed (2 tests). No new `twoslash`
fences were added.
- `pnpm dev`, then requesting all 7 edited pages: all returned HTTP 200
with no error overlay. Checked the rendered tabs, code blocks, and
troubleshooting table with `playwright-cli`.
- TypeScript samples: type-checked with `tsc` against the SDK generated
by `aspire add` for `17.1.0-preview.1.26556.5` (Front Door, Container
Apps, App Service, Dotnet, and Provisioning.Cdn packages). Passed.
`withAzureFrontDoorPrivateLink` is present on both
`AzureContainerAppEnvironmentResource` and
`AzureAppServiceEnvironmentResource`, and on `17.0.0-preview.1.26552.6`
for Container Apps.
- C# samples: `dotnet build apphost.cs` with the same packages: passed
with no warnings. Removing the `#pragma` produced error
`ASPIREAZURE003`.
- `aspire publish` for the TypeScript Container Apps sample (with the
region override) and the App Service sample: both succeeded. The
generated Bicep confirmed the `Premium_AzureFrontDoor` SKU,
`publicNetworkAccess: 'Disabled'`, `managedEnvironments` and `sites`
group IDs, the request message, `privateLinkLocation: 'westus2'`, and
the `<name>_website_resourceId_input` parameters in `main.bicep`.
- Not run: `pnpm build` (CI does this per repo policy) and an end-to-end
Azure deployment.
---------
Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
WithAzureFrontDoorPrivateLinkso an AppHost can opt in to reaching an Azure Container Apps environment through an Azure Front Door Private Link. When the Private Link is established, public network access on the Container Apps environment is disabled, the same way it is when a compute resource has a private endpoint to another Azure resource such as a storage account (PrivateEndpointTargetAnnotation).When publishing:
publicNetworkAccess: 'Disabled', and the environment now always emits anAZURE_CONTAINER_APPS_ENVIRONMENT_LOCATIONoutput with its other well-known outputs, including for existing environments, so the existing environment snapshots gain that one line.Premium_AzureFrontDoor, the origin gets asharedPrivateLinkResourcethat targets the environment (groupmanagedEnvironments) withenforceCertificateNameCheck, and Front Door routes forward over HTTPS only, as they already did. Origins in other compute environments are left alone. The call can be made before or afterWithOrigin; the conversion happens when the Front Door module is generated.westus2forwestus). The environment module'sAZURE_CONTAINER_APPS_ENVIRONMENT_LOCATIONoutput is the programmatic name (toLower(replace(env.location, ' ', '')), because a managed environment returns a display name such asWest US 2). Because that region is only known at deployment, the Front Door module declares a BicepprivateLinkRegionsmap of the 29 regions that need a remap and looks the environment's region up in it, keeping the region when it isn't listed. The map never crosses a geography, so data residency doesn't change; for the regions whose geography has no supported region (for example Switzerland North) it passes the region through, and deployment fails in Front Door. To use a different region, set the origin'sSharedPrivateLinkResource.PrivateLinkLocationinConfigureInfrastructureon the Front Door, for example from a parameter (shown in the Front Door README and covered by a test). The map has to be kept in sync with the Front Door Private Link regions.az network private-endpoint-connection approve; this is documented in the XML docs and the Front Door README. There is no automatic approval.Publish fails with an actionable message when the environment is an Express or existing environment, when a connected Front Door has no origin in the environment, or when a Front Door that isn't connected has an origin in the locked-down environment.
Run mode is a no-op.
Notes for reviewers
WithAzureFrontDoorPrivateLink<T>is generic over a newIAzureCdnPrivateLinkTargetinterface inAspire.Hosting.Azure(named for the general technology, since Front Door is aMicrosoft.Cdnprofile; a compute environment that is itself the Azure resource a CDN profile's managed private endpoint connects to: its resource ID output, region output, and Private Link group ID).AzureContainerAppEnvironmentResourceimplements it explicitly, so there is no new public surface on the Container Apps type.Aspire.Hosting.Azure.FrontDoordoes not referenceAspire.Hosting.Azure.AppContainers, and there is no newInternalsVisibleTo. App Service and AKS can implement the interface later.[Experimental("ASPIREAZURE003")]like the other private networking APIs. The extension is exported for polyglot AppHosts aswithAzureFrontDoorPrivateLink(frontDoor), following theWithDelegatedSubnet<T>precedent for generic exports.PrivateEndpointTargetAnnotation, so the Container Apps module disables public network access the same way other resources do for a private endpoint.Validation
dotnet test --project tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true": passed (2104 total, 2099 succeeded, 5 skipped), including 20 new test cases inAzureFrontDoorPrivateLinkTests(one uses a non-Container Apps target to cover the interface, one overrides the location withConfigureInfrastructure, and two cover the region map) and the existing Front Door snapshots unchanged (the Container Apps environment snapshots only gain the location output). The generated Front Door module also compiles withbicep build(0.46.1).bicep build(Bicep CLI 0.46.1); only the usual unused-parameter linter warnings.aspire publishon a starter app with two external origins generates the expected Bicep,aspire startruns normally locally, and an Express environment, an unconnected Front Door, and a connected Front Door with no origin each fail at publish with a clear message.Checklist
<remarks />and<code />elements on your triple slash comments?