# WithHostPort

- Module: [Aspire.Hosting.Redis](/reference/api/go/aspire.hosting.redis.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`RedisInsightResource`](/reference/api/go/aspire.hosting.redis/redisinsightresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Configures the host port that the Redis Insight resource is exposed on instead of using randomly assigned port.

## Definition

```go
func (RedisInsightResource) WithHostPort(port *float64) RedisInsightResource
```

## Parameters

- `port` (`*float64`) -- The port to bind on the host. If `null` is used random port will be assigned.

## Returns

[`RedisInsightResource`](/reference/api/go/aspire.hosting.redis/redisinsightresource.md) -- The resource builder for RedisInsight.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`RedisInsightResource`](/reference/api/go/aspire.hosting.redis/redisinsightresource.md)
