# AzureSubnetServiceDelegations

- Kind: `class`
- Package: [Aspire.Hosting.Azure](/reference/api/csharp/aspire.hosting.azure.md)
- Version: `13.5.1`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/69db530a4816698cf1d5fa4557933e0ac4f127c6/src/Aspire.Hosting.Azure/AzureSubnetServiceDelegations.cs)

Well-known Azure service identifiers for subnet service delegation.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public static class AzureSubnetServiceDelegations
{
    // ...
}
```

## Remarks

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](https://learn.microsoft.com/azure/virtual-network/subnet-delegation-overview).

## Fields

- [ApplicationGatewayForContainers](/reference/api/csharp/aspire.hosting.azure/azuresubnetservicedelegations/fields.md#applicationgatewayforcontainers) : `string` `static` -- Delegation for Azure Application Gateway for Containers.
- [AppServiceEnvironments](/reference/api/csharp/aspire.hosting.azure/azuresubnetservicedelegations/fields.md#appserviceenvironments) : `string` `static` -- Delegation for Azure App Service environments.
- [ContainerAppEnvironments](/reference/api/csharp/aspire.hosting.azure/azuresubnetservicedelegations/fields.md#containerappenvironments) : `string` `static` -- Delegation for Azure Container Apps environments.
- [ContainerInstances](/reference/api/csharp/aspire.hosting.azure/azuresubnetservicedelegations/fields.md#containerinstances) : `string` `static` -- Delegation for Azure Container Instances (ACI), which allows container groups to be deployed into the subnet.

## Examples

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

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