Skip to content
Discussion options

You must be logged in to vote

You configure this on each App Service website, rather than on AddAzureAppServiceEnvironment.

Delegate the subnet to Microsoft.Web/serverFarms, then use PublishAsAzureAppServiceWebsite to set WebSite.VirtualNetworkSubnetId:

#pragma warning disable ASPIREAZURE003

using Aspire.Hosting.Azure;

var vnet = builder.AddAzureVirtualNetwork("app-vnet");
var subnet = vnet.AddSubnet("appservice-subnet", "10.0.0.0/24");

subnet.WithAnnotation(new AzureSubnetServiceDelegationAnnotation(
    "appservice-delegation",
    "Microsoft.Web/serverFarms"));

builder.AddAzureAppServiceEnvironment("appservice");

builder.AddProject<Projects.Web>("web")
    .WithExternalHttpEndpoints()
    .PublishAsAzureAppSer…

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@Lindsay-Mathieson
Comment options

@Lindsay-Mathieson
Comment options

@davidfowl
Comment options

@davidfowl
Comment options

@Lindsay-Mathieson
Comment options

Answer selected by Lindsay-Mathieson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants