# WithHostPort

- Module: [Aspire.Hosting.Azure.AppConfiguration](/reference/api/go/aspire.hosting.azure.appconfiguration.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`AzureAppConfigurationEmulatorResource`](/reference/api/go/aspire.hosting.azure.appconfiguration/azureappconfigurationemulatorresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Configures the host port for the Azure App Configuration emulator is exposed on instead of using randomly assigned port.

## Definition

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

## Parameters

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

## Returns

[`AzureAppConfigurationEmulatorResource`](/reference/api/go/aspire.hosting.azure.appconfiguration/azureappconfigurationemulatorresource.md) -- The resource builder.

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

## Applies to

- [`AzureAppConfigurationEmulatorResource`](/reference/api/go/aspire.hosting.azure.appconfiguration/azureappconfigurationemulatorresource.md)
