# withServicePort

- Module: [Aspire.Hosting.Kubernetes](/reference/api/typescript/aspire.hosting.kubernetes.md)
- Version: `13.4.0-preview.1.26281.18`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Sets the Kubernetes Service port for the Aspire Dashboard HTTP endpoint.

## Definition

```typescript
interface KubernetesAspireDashboardResource {
  // ... omitted for brevity
  withServicePort(port?: number): KubernetesAspireDashboardResource
}
```

## Parameters

- `port` (`number`) `optional`

## Returns

[KubernetesAspireDashboardResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesaspiredashboardresource.md) `builder`

## Applies to

- [KubernetesAspireDashboardResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesaspiredashboardresource.md)
