# AzureSubnetResource.withServiceDelegation

- Module: [Aspire.Hosting.Azure.Network](/reference/api/typescript/aspire.hosting.azure.network.md)
- Defined on: [AzureSubnetResource](/reference/api/typescript/aspire.hosting.azure.network/azuresubnetresource.md)
- Version: `13.5.3`
- Kind: `method`

Delegates the subnet to the specified Azure service.

## Definition

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

## Signature

```typescript
withServiceDelegation(
    serviceName: string,
    name?: string): AzureSubnetResource
```

## Parameters

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

## Returns

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

## Defined on

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