# AzureCosmosDBEmulatorResource.WithGatewayPort

- Module: [Aspire.Hosting.Azure.CosmosDB](/reference/api/go/aspire.hosting.azure.cosmosdb.md)
- Defined on: [AzureCosmosDBEmulatorResource](/reference/api/go/aspire.hosting.azure.cosmosdb/azurecosmosdbemulatorresource.md)
- Version: `17.0.0`
- Kind: `method`

Configures the gateway port for the Azure Cosmos DB emulator.

## Definition

```go
type AzureCosmosDBEmulatorResource interface {
    // ... omitted for brevity
    WithGatewayPort(port *float64) AzureCosmosDBEmulatorResource
}
```

## Signature

```go
WithGatewayPort(port *float64) AzureCosmosDBEmulatorResource
```

## Parameters

- `port` (`*float64`) -- Host port to bind to the emulator gateway port.

## Returns

[`AzureCosmosDBEmulatorResource`](/reference/api/go/aspire.hosting.azure.cosmosdb/azurecosmosdbemulatorresource.md) -- Cosmos emulator resource builder.

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

## Defined on

- [AzureCosmosDBEmulatorResource](/reference/api/go/aspire.hosting.azure.cosmosdb/azurecosmosdbemulatorresource.md) -- `handle`
