# AzureStorageExplorerBuilderExtensions Methods

- Package: [CommunityToolkit.Aspire.Hosting.Azure.Extensions](/reference/api/csharp/communitytoolkit.aspire.hosting.azure.extensions.md)
- Type: [AzureStorageExplorerBuilderExtensions](/reference/api/csharp/communitytoolkit.aspire.hosting.azure.extensions/azurestorageexplorerbuilderextensions.md)
- Kind: `Methods`
- Members: `1`

Provides extension methods for adding Azure Storage Explorer resources to the application model.

## WithHostPort(IResourceBuilder<AzureStorageExplorerResource>, int?)

- Name: `WithHostPort(IResourceBuilder<AzureStorageExplorerResource>, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<AzureStorageExplorerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.Azure.Extensions/AzureStorageExplorerBuilderExtensions.cs#L25-L30)

Configures the host port that the Azure Storage Explorer resource is exposed on instead of using randomly assigned port.

```csharp
public static class AzureStorageExplorerBuilderExtensions
{
    public static IResourceBuilder<AzureStorageExplorerResource> WithHostPort(
        this IResourceBuilder<AzureStorageExplorerResource> builder,
        int? port)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<AzureStorageExplorerResource>`)
  The resource builder for Azure Storage Explorer.
- `port` (`int?`)
  The port to bind on the host. If `null` is used random port will be assigned.

## Returns

`IResourceBuilder<AzureStorageExplorerResource>` -- The resource builder for Azure Storage Explorer.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
