Aspire.Hosting.Azure.FrontDoor
17.0.0-preview.1.26567.5
Prefix Reserved
dotnet add package Aspire.Hosting.Azure.FrontDoor --version 17.0.0-preview.1.26567.5
NuGet\Install-Package Aspire.Hosting.Azure.FrontDoor -Version 17.0.0-preview.1.26567.5
<PackageReference Include="Aspire.Hosting.Azure.FrontDoor" Version="17.0.0-preview.1.26567.5" />
<PackageVersion Include="Aspire.Hosting.Azure.FrontDoor" Version="17.0.0-preview.1.26567.5" />
<PackageReference Include="Aspire.Hosting.Azure.FrontDoor" />
paket add Aspire.Hosting.Azure.FrontDoor --version 17.0.0-preview.1.26567.5
#r "nuget: Aspire.Hosting.Azure.FrontDoor, 17.0.0-preview.1.26567.5"
#:package Aspire.Hosting.Azure.FrontDoor@17.0.0-preview.1.26567.5
#addin nuget:?package=Aspire.Hosting.Azure.FrontDoor&version=17.0.0-preview.1.26567.5&prerelease
#tool nuget:?package=Aspire.Hosting.Azure.FrontDoor&version=17.0.0-preview.1.26567.5&prerelease
Azure Front Door hosting integration
Use this integration to model, configure, and orchestrate an Azure Front Door resource in an Aspire solution.
Getting started
Prerequisites
- An Azure subscription - create one for free
Add the integration
From your AppHost directory, add the Aspire.Hosting.Azure.FrontDoor integration with the Aspire CLI:
aspire add Aspire.Hosting.Azure.FrontDoor
aspire add Aspire.Hosting.Dotnet
Usage example
In the AppHost, add an Azure Front Door resource and configure origins with either C# or TypeScript:
C#
var api = builder.AddDotnetProject("api", "../Api/Api.csproj")
.WithExternalHttpEndpoints();
var frontDoor = builder.AddAzureFrontDoor("frontdoor")
.WithOrigin(api);
TypeScript
const api = await builder.addNodeApp("api", "../api", "server.js")
.withExternalHttpEndpoints();
const frontDoor = await builder.addAzureFrontDoor("frontdoor")
.withOrigin(api);
Private Link to Azure Container Apps
To let an Azure Container Apps environment accept traffic only from Azure Front Door, call WithAzureFrontDoorPrivateLink
on the environment and add the apps to the Front Door with WithOrigin. WithAzureFrontDoorPrivateLink is experimental. C#
callers must opt in by suppressing ASPIREAZURE003, as shown below.
C#
#pragma warning disable ASPIREAZURE003 // WithAzureFrontDoorPrivateLink is experimental.
using Aspire.Hosting;
var builder = DistributedApplication.CreateBuilder(args);
var environment = builder.AddAzureContainerAppEnvironment("env");
var frontDoor = builder.AddAzureFrontDoor("frontdoor");
environment.WithAzureFrontDoorPrivateLink(frontDoor);
var api = builder.AddDotnetProject("api", "../Api/Api.csproj")
.WithExternalHttpEndpoints();
frontDoor.WithOrigin(api);
builder.Build().Run();
#pragma warning restore ASPIREAZURE003
TypeScript
import { createBuilder } from "./.aspire/modules/aspire.mjs";
const builder = await createBuilder();
const environment = await builder.addAzureContainerAppEnvironment("env");
const frontDoor = await builder.addAzureFrontDoor("frontdoor");
await environment.withAzureFrontDoorPrivateLink(frontDoor);
const api = await builder.addNodeApp("api", "../api", "server.js")
.withHttpEndpoint({ env: "PORT" })
.withExternalHttpEndpoints();
await frontDoor.withOrigin(api);
await builder.build().run();
When you publish, the environment's public network access is disabled, the Front Door profile uses the Premium SKU, and each origin in the environment connects through a Front Door managed private endpoint. The environment must be a workload profiles environment that Aspire provisions, not an existing or Express environment.
The private endpoint is created in the environment's region when Front Door offers Private Link there. Front Door only offers
Private Link in some regions, so for an
environment in another region the private endpoint is created in the supported region of the same geography, for example
westus2 for an environment in westus, at the cost of an extra network hop. A geography without a supported region, such as
Switzerland, isn't remapped and deployment fails. In that case, or to choose a different region, set the location of each
Private Link origin in ConfigureInfrastructure. The following AppHost sets it from a parameter. Its value is the Azure region for
the private endpoint, such as westus2, which you provide when you deploy:
#pragma warning disable ASPIREAZURE003 // WithAzureFrontDoorPrivateLink is experimental.
using Aspire.Hosting;
using Azure.Provisioning.Cdn;
var builder = DistributedApplication.CreateBuilder(args);
var privateLinkLocation = builder.AddParameter("privateLinkLocation");
var environment = builder.AddAzureContainerAppEnvironment("env");
var frontDoor = builder.AddAzureFrontDoor("frontdoor")
.ConfigureInfrastructure(infrastructure =>
{
// Create the parameter once, before looping over the origins.
var location = privateLinkLocation.AsProvisioningParameter(infrastructure);
foreach (var origin in infrastructure.GetProvisionableResources().OfType<FrontDoorOrigin>())
{
// Origins that aren't Private Link origins still have an empty SharedPrivateLinkResource model.
var privateLink = origin.SharedPrivateLinkResource;
if (!privateLink.PrivateLinkId.IsEmpty)
{
privateLink.PrivateLinkLocation = location;
}
}
});
environment.WithAzureFrontDoorPrivateLink(frontDoor);
var api = builder.AddDotnetProject("api", "../Api/Api.csproj")
.WithExternalHttpEndpoints();
frontDoor.WithOrigin(api);
builder.Build().Run();
#pragma warning restore ASPIREAZURE003
Front Door creates the connection request in the Pending state, and no traffic reaches the apps until the environment's owner approves it, in the Azure portal or with the Azure CLI:
az network private-endpoint-connection approve --id <private-endpoint-connection-id>
Find the connection ID with az network private-endpoint-connection list --type Microsoft.App/managedEnvironments --name <environment-name> --resource-group <resource-group>.
Front Door can create more than one request, so approve each one whose description names the Front Door and the environment.
Traffic starts flowing a few minutes after approval.
Private Link to Azure App Service
The same API supports an Azure App Service environment:
C#
#pragma warning disable ASPIREAZURE003 // WithAzureFrontDoorPrivateLink is experimental.
var environment = builder.AddAzureAppServiceEnvironment("env");
var frontDoor = builder.AddAzureFrontDoor("frontdoor");
environment.WithAzureFrontDoorPrivateLink(frontDoor);
var api = builder.AddProject<Projects.Api>("api")
.WithExternalHttpEndpoints();
var web = builder.AddProject<Projects.Web>("web")
.WithExternalHttpEndpoints();
frontDoor.WithOrigin(api).WithOrigin(web);
#pragma warning restore ASPIREAZURE003
TypeScript
const environment = await builder.addAzureAppServiceEnvironment("env");
const frontDoor = await builder.addAzureFrontDoor("frontdoor");
await environment.withAzureFrontDoorPrivateLink(frontDoor);
const api = await builder.addProject("api", "../Api/Api.csproj")
.withExternalHttpEndpoints();
const web = await builder.addProject("web", "../Web/Web.csproj")
.withExternalHttpEndpoints();
await frontDoor.withOrigin(api).withOrigin(web);
Add both the App Service and Front Door integrations to the AppHost. Each App Service origin connects to its own website
(Microsoft.Web/sites, group ID sites), not to the App Service plan. The Front Door profile uses Premium, and the private
endpoint region follows the same region mapping described above, using the website's location.
aspire deploy deploys the websites before Front Door and resolves their resource IDs and locations automatically.
aspire publish writes website modules separately from main.bicep; the latter exposes the required website IDs and
locations as input parameters. When applying the published assets yourself, deploy the environment and website modules
first, then supply those website outputs to the Front Door infrastructure.
Public network access is disabled on all workload websites in the connected environment, including websites not added
as Front Door origins. The separately provisioned Aspire dashboard is unchanged; disable it with WithDashboard(false)
if it is not needed. Existing App Service plans are supported, since Aspire still provisions the websites.
With WithDeploymentSlot, Front Door Private Link can't target a slot
(documented limitation),
so each origin targets the production site. The slot has public access disabled and no private endpoint, so it is
not reachable through Front Door; deploy to the slot and swap it into production, and test the slot before the swap
over a private network connection. Aspire creates the production site only if it does not exist, so adding Private Link
to a site that already exists does not disable its public access; change it on the site yourself.
After aspire deploy, approve the pending connection on each website, not on the plan:
az network private-endpoint-connection list --type Microsoft.Web/sites --name <website-name> --resource-group <resource-group>
az network private-endpoint-connection approve --id <private-endpoint-connection-id>
Approve every request whose description names this Front Door and environment. Allow a few minutes for Front Door to
propagate the approval. Direct requests to the website's *.azurewebsites.net URL are denied; use its Front Door URL.
Unlike Container Apps, App Service does not provide environment-local ingress between apps. WithReference continues
to use the website hostname, which is not publicly accessible in this configuration. Service-to-service callers must use
the Front Door URLs (available through frontDoor.Resource.GetEndpointUrl("api")) or configure their own private
networking and DNS. Passing a Front Door output back into one of its origins creates a deployment dependency cycle;
configure such URLs separately after deployment.
Additional documentation
- https://aspire.dev/integrations/gallery/
- https://aspire.dev/integrations/cloud/azure/azure-front-door/
- https://learn.microsoft.com/azure/frontdoor/
- https://learn.microsoft.com/azure/container-apps/how-to-integrate-with-azure-front-door
- https://learn.microsoft.com/azure/frontdoor/standard-premium/how-to-enable-private-link-web-app
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aspire.Hosting.Azure (>= 17.0.0)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Azure.Core (>= 1.63.0)
- Azure.Identity (>= 1.21.0)
- Azure.Provisioning (>= 1.6.0)
- Azure.Provisioning.Cdn (>= 1.0.0-beta.4)
- Azure.Provisioning.KeyVault (>= 1.1.0)
- Azure.ResourceManager.Authorization (>= 1.1.7)
- Azure.ResourceManager.KeyVault (>= 1.4.0)
- Azure.ResourceManager.Resources.Deployments (>= 1.0.0)
- Azure.Security.KeyVault.Secrets (>= 4.11.1)
- Google.Protobuf (>= 3.36.1)
- Grpc.AspNetCore (>= 2.83.0)
- Grpc.Net.ClientFactory (>= 2.83.0)
- Grpc.Tools (>= 2.83.0)
- Hex1b (>= 0.173.0)
- KubernetesClient (>= 19.0.2)
- MessagePack (>= 2.5.307)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.15)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.15)
- Microsoft.Extensions.Hosting (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Http (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Microsoft.Extensions.Primitives (>= 10.0.15)
- ModelContextProtocol (>= 1.4.1)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.18.0)
- OpenTelemetry.Extensions.Hosting (>= 1.18.0)
- Polly.Core (>= 8.7.0)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.15)
- YamlDotNet (>= 18.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Aspire.Hosting.Azure.FrontDoor:
| Package | Downloads |
|---|---|
|
Aspire.Hosting.Azure.Provisioning.Cdn
Opt-in Azure Provisioning CDN and Front Door APIs for polyglot Aspire AppHosts. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 17.0.0-preview.1.26567.5 | 196 | 11/18/2026 |
| 13.6.5-preview.1.26559.7 | 1,019 | 11/10/2026 |
| 13.6.4-preview.1.26523.11 | 316 | 10/24/2026 |
| 13.6.3-preview.1.26521.2 | 113 | 10/21/2026 |
| 13.6.2-preview.1.26519.11 | 132 | 10/20/2026 |
| 13.6.1-preview.1.26506.6 | 502 | 10/7/2026 |
| 13.6.0-preview.1.26479.8 | 1,526 | 9/29/2026 |
| 13.5.4-preview.1.26464.4 | 313 | 9/15/2026 |
| 13.5.3-preview.1.26425.3 | 5,674 | 8/25/2026 |
| 13.5.2-preview.1.26421.6 | 419 | 8/21/2026 |
| 13.5.1-preview.1.26420.4 | 507 | 8/20/2026 |
| 13.5.0-preview.1.26417.10 | 144 | 8/18/2026 |
| 13.4.6-preview.1.26319.6 | 8,898 | 6/19/2026 |
| 13.4.5-preview.1.26316.12 | 304 | 6/17/2026 |
| 13.4.4-preview.1.26314.3 | 215 | 6/15/2026 |
| 13.4.3-preview.1.26305.13 | 2,099 | 6/8/2026 |
| 13.4.2-preview.1.26303.6 | 240 | 6/3/2026 |
| 13.4.1-preview.1.26303.3 | 100 | 6/3/2026 |
| 13.4.0-preview.1.26281.18 | 484 | 6/1/2026 |
| 13.3.5-preview.1.26270.6 | 836 | 5/21/2026 |