Skip to content
DocsTry Aspire
DocsTry

AzureSubnetServiceDelegations

Classstaticnet10.0
📦 Aspire.Hosting.Azure v13.5.1
Well-known Azure service identifiers for subnet service delegation.
namespace Aspire.Hosting.Azure;
public static class AzureSubnetServiceDelegations
{
// ...
}
Delegating a subnet grants an Azure service permission to create service-specific resources in that subnet. These constants provide discoverable, strongly-named values for the services Aspire integrates with, so callers don't have to remember or duplicate the underlying resource provider strings when delegating a subnet. Each value is an Azure resource provider path; see Subnet delegation.

This example delegates a subnet to Azure Container Instances using a well-known value:

var vnet = builder.AddAzureVirtualNetwork("vnet");
var subnet = vnet.AddSubnet("aci-subnet", "10.0.0.0/23")
.WithServiceDelegation(AzureSubnetServiceDelegations.ContainerInstances);