# withServiceDelegation

- Module: [Aspire.Hosting.Azure.Network](/reference/api/typescript/aspire.hosting.azure.network.md)
- Version: `13.5.1`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/69db530a4816698cf1d5fa4557933e0ac4f127c6)

Delegates the subnet to the specified Azure service.

## Definition

```typescript
interface AzureSubnetResource {
  // ... omitted for brevity
  withServiceDelegation(
    serviceName: string,
    name?: string): AzureSubnetResource
}
```

## Parameters

- `serviceName` (`string`)
- `name` (`string`) `optional`

## Returns

[AzureSubnetResource](/reference/api/typescript/aspire.hosting.azure.network/azuresubnetresource.md) `builder`

## Applies to

- [AzureSubnetResource](/reference/api/typescript/aspire.hosting.azure.network/azuresubnetresource.md)
