# FlociHostingExtension Methods

- Package: [CommunityToolkit.Aspire.Hosting.Floci](/reference/api/csharp/communitytoolkit.aspire.hosting.floci.md)
- Type: [FlociHostingExtension](/reference/api/csharp/communitytoolkit.aspire.hosting.floci/flocihostingextension.md)
- Kind: `Methods`
- Members: `27`

Provides extension methods for adding Floci to an `Hosting.IDistributedApplicationBuilder`.

<a id="addflociaws"></a>
<a id="addflociaws-idistributedapplicationbuilder-string-int-string-string"></a>

## AddFlociAws(IDistributedApplicationBuilder, string, int?, string, string)

- Name: `AddFlociAws(IDistributedApplicationBuilder, string, int?, string, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAwsContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs#L29-L53)

Adds a Floci AWS emulator container resource to the `Hosting.IDistributedApplicationBuilder`.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAwsContainerResource> AddFlociAws(
        this IDistributedApplicationBuilder builder,
        string name,
        int? port = null,
        string defaultRegion = "us-east-1",
        string defaultAccountId = "000000000000")
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder` to which the Floci resource will be added.
- `name` (`string`)
  The name of the Floci container resource.
- `port` (`int?`) `optional`
  Optional. The host port to bind for the AWS endpoint.
- `defaultRegion` (`string`) `optional`
  Optional. The default AWS region (default: `us-east-1`).
- `defaultAccountId` (`string`) `optional`
  Optional. The default AWS account ID (default: `000000000000`).

## Returns

`IResourceBuilder<FlociAwsContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further resource configuration.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="addflociazure"></a>
<a id="addflociazure-idistributedapplicationbuilder-string-int"></a>

## AddFlociAzure(IDistributedApplicationBuilder, string, int?)

- Name: `AddFlociAzure(IDistributedApplicationBuilder, string, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAzureContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Azure.cs#L24-L46)

Adds a Floci Azure emulator container resource to the `Hosting.IDistributedApplicationBuilder`.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAzureContainerResource> AddFlociAzure(
        this IDistributedApplicationBuilder builder,
        string name,
        int? port = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder` to which the Floci resource will be added.
- `name` (`string`)
  The name of the Floci container resource.
- `port` (`int?`) `optional`
  Optional. The host port to bind for the Azure endpoint.

## Returns

`IResourceBuilder<FlociAzureContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further resource configuration.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="addflocigcp"></a>
<a id="addflocigcp-idistributedapplicationbuilder-string-int-string"></a>

## AddFlociGcp(IDistributedApplicationBuilder, string, int?, string)

- Name: `AddFlociGcp(IDistributedApplicationBuilder, string, int?, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociGcpContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Gcp.cs#L24-L45)

Adds a Floci GCP emulator container resource to the `Hosting.IDistributedApplicationBuilder`.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociGcpContainerResource> AddFlociGcp(
        this IDistributedApplicationBuilder builder,
        string name,
        int? port = null,
        string defaultProjectId = "floci-local")
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder` to which the Floci resource will be added.
- `name` (`string`)
  The name of the Floci container resource.
- `port` (`int?`) `optional`
  Optional. The host port to bind for the GCP endpoint.
- `defaultProjectId` (`string`) `optional`
  Optional. The default GCP project ID (default: `floci-local`).

## Returns

`IResourceBuilder<FlociGcpContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further resource configuration.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withconfigfile"></a>
<a id="withconfigfile-iresourcebuilder-flociawscontainerresource-string"></a>

## WithConfigFile(IResourceBuilder<FlociAwsContainerResource>, string)

- Name: `WithConfigFile(IResourceBuilder<FlociAwsContainerResource>, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAwsContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs#L110-L113)

Mounts a custom Quarkus `application.yml` configuration file into the Floci container. The file is mounted read-only at `/deployments/config/application.yml`, which Quarkus reads on startup and merges with built-in defaults.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAwsContainerResource> WithConfigFile(
        this IResourceBuilder<FlociAwsContainerResource> builder,
        string hostPath)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAwsContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `hostPath` (`string`)
  The host-side path to the `application.yml` file to mount.

## Returns

`IResourceBuilder<FlociAwsContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withcosmos"></a>
<a id="withcosmos-iresourcebuilder-flociazurecontainerresource-string-string"></a>

## WithCosmos(IResourceBuilder<FlociAzureContainerResource>, string, string?)

- Name: `WithCosmos(IResourceBuilder<FlociAzureContainerResource>, string, string?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAzureCosmosResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Azure.cs#L244-L254)

Adds a child resource representing the Cosmos DB API exposed by the Floci Azure emulator.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAzureCosmosResource> WithCosmos(
        this IResourceBuilder<FlociAzureContainerResource> builder,
        string name = "cosmos",
        string? accountName = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAzureContainerResource>`)
  The Floci Azure resource builder.
- `name` (`string`) `optional`
  The name of the Cosmos DB resource (default: `cosmos`).
- `accountName` (`string?`) `optional`
  The Cosmos account name segment (default: `devstoreaccount1`).

## Returns

`IResourceBuilder<FlociAzureCosmosResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## Remarks

Reference the returned resource with Aspire's standard `WithReference` API to inject its Cosmos DB connection string. floci-az serves the Cosmos SQL/NoSQL API from the parent resource's endpoint under the `{account}-cosmos` path.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withdatabindmount"></a>
<a id="withdatabindmount-iresourcebuilder-flociawscontainerresource-string-bool"></a>

## WithDataBindMount(IResourceBuilder<FlociAwsContainerResource>, string, bool)

- Name: `WithDataBindMount(IResourceBuilder<FlociAwsContainerResource>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAwsContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Configures a bind mount for persistent Floci state.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAwsContainerResource> WithDataBindMount(
        this IResourceBuilder<FlociAwsContainerResource> builder,
        string source,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAwsContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `source` (`string`)
  The host path to bind into the container.
- `isReadOnly` (`bool`) `optional`
  Whether the bind mount should be read-only.

## Returns

`IResourceBuilder<FlociAwsContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withdatabindmount-iresourcebuilder-flociazurecontainerresource-string-bool"></a>

## WithDataBindMount(IResourceBuilder<FlociAzureContainerResource>, string, bool)

- Name: `WithDataBindMount(IResourceBuilder<FlociAzureContainerResource>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAzureContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Configures a bind mount for persistent Floci Azure state.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAzureContainerResource> WithDataBindMount(
        this IResourceBuilder<FlociAzureContainerResource> builder,
        string source,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAzureContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `source` (`string`)
  The host path to bind into the container.
- `isReadOnly` (`bool`) `optional`
  Whether the bind mount should be read-only.

## Returns

`IResourceBuilder<FlociAzureContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withDataBindMountAzure`
- Generated method name override: `withDataBindMount`

<a id="withdatabindmount-iresourcebuilder-flocigcpcontainerresource-string-bool"></a>

## WithDataBindMount(IResourceBuilder<FlociGcpContainerResource>, string, bool)

- Name: `WithDataBindMount(IResourceBuilder<FlociGcpContainerResource>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociGcpContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Configures a bind mount for persistent Floci GCP state.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociGcpContainerResource> WithDataBindMount(
        this IResourceBuilder<FlociGcpContainerResource> builder,
        string source,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociGcpContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `source` (`string`)
  The host path to bind into the container.
- `isReadOnly` (`bool`) `optional`
  Whether the bind mount should be read-only.

## Returns

`IResourceBuilder<FlociGcpContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withDataBindMountGcp`
- Generated method name override: `withDataBindMount`

<a id="withdatavolume"></a>
<a id="withdatavolume-iresourcebuilder-flociawscontainerresource-string-bool"></a>

## WithDataVolume(IResourceBuilder<FlociAwsContainerResource>, string, bool)

- Name: `WithDataVolume(IResourceBuilder<FlociAwsContainerResource>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAwsContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Configures a named data volume for persistent Floci state.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAwsContainerResource> WithDataVolume(
        this IResourceBuilder<FlociAwsContainerResource> builder,
        string name,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAwsContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `name` (`string`)
  The name of the volume to mount.
- `isReadOnly` (`bool`) `optional`
  Whether the volume should be read-only.

## Returns

`IResourceBuilder<FlociAwsContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withdatavolume-iresourcebuilder-flociazurecontainerresource-string-bool"></a>

## WithDataVolume(IResourceBuilder<FlociAzureContainerResource>, string, bool)

- Name: `WithDataVolume(IResourceBuilder<FlociAzureContainerResource>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAzureContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Configures a named data volume for persistent Floci Azure state.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAzureContainerResource> WithDataVolume(
        this IResourceBuilder<FlociAzureContainerResource> builder,
        string name,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAzureContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `name` (`string`)
  The name of the volume to mount.
- `isReadOnly` (`bool`) `optional`
  Whether the volume should be read-only.

## Returns

`IResourceBuilder<FlociAzureContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withDataVolumeAzure`
- Generated method name override: `withDataVolume`

<a id="withdatavolume-iresourcebuilder-flocigcpcontainerresource-string-bool"></a>

## WithDataVolume(IResourceBuilder<FlociGcpContainerResource>, string, bool)

- Name: `WithDataVolume(IResourceBuilder<FlociGcpContainerResource>, string, bool)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociGcpContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Configures a named data volume for persistent Floci GCP state.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociGcpContainerResource> WithDataVolume(
        this IResourceBuilder<FlociGcpContainerResource> builder,
        string name,
        bool isReadOnly = false)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociGcpContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `name` (`string`)
  The name of the volume to mount.
- `isReadOnly` (`bool`) `optional`
  Whether the volume should be read-only.

## Returns

`IResourceBuilder<FlociGcpContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withDataVolumeGcp`
- Generated method name override: `withDataVolume`

<a id="withdockersocket"></a>
<a id="withdockersocket-iresourcebuilder-flociawscontainerresource-string"></a>

## WithDockerSocket(IResourceBuilder<FlociAwsContainerResource>, string)

- Name: `WithDockerSocket(IResourceBuilder<FlociAwsContainerResource>, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAwsContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Mounts the Docker socket into the Floci container so that Lambda and other container-backed AWS services can launch sibling containers. Also sets `FLOCI_DOCKER_DOCKER_HOST` to `unix:///var/run/docker.sock` (the container-side path where the socket is always mounted) so Floci can connect to it.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAwsContainerResource> WithDockerSocket(
        this IResourceBuilder<FlociAwsContainerResource> builder,
        string socketPath = "/var/run/docker.sock")
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAwsContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `socketPath` (`string`) `optional`
  Optional. Host path to the Docker socket (default: `/var/run/docker.sock`). Non-standard paths (e.g. Podman at `/run/user/1000/podman/podman.sock`) are bind-mounted to `/var/run/docker.sock` inside the container.

## Returns

`IResourceBuilder<FlociAwsContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withdockersocket-iresourcebuilder-flociazurecontainerresource-string"></a>

## WithDockerSocket(IResourceBuilder<FlociAzureContainerResource>, string)

- Name: `WithDockerSocket(IResourceBuilder<FlociAzureContainerResource>, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAzureContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Mounts the Docker socket into the Floci Azure container so that Azure Functions and other container-backed services can launch sibling containers. Also sets `FLOCI_AZ_DOCKER_DOCKER_HOST` to `unix:///var/run/docker.sock` (the container-side path where the socket is always mounted) so Floci can connect to it.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAzureContainerResource> WithDockerSocket(
        this IResourceBuilder<FlociAzureContainerResource> builder,
        string socketPath = "/var/run/docker.sock")
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAzureContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `socketPath` (`string`) `optional`
  Optional. Host path to the Docker socket (default: `/var/run/docker.sock`). Non-standard paths (e.g. Podman at `/run/user/1000/podman/podman.sock`) are bind-mounted to `/var/run/docker.sock` inside the container.

## Returns

`IResourceBuilder<FlociAzureContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withDockerSocketAzure`
- Generated method name override: `withDockerSocket`

<a id="withdockersocket-iresourcebuilder-flocigcpcontainerresource-string"></a>

## WithDockerSocket(IResourceBuilder<FlociGcpContainerResource>, string)

- Name: `WithDockerSocket(IResourceBuilder<FlociGcpContainerResource>, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociGcpContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Mounts the Docker socket into the Floci GCP container so that Cloud Run, Cloud SQL, and other container-backed services can launch sibling containers. Also sets `FLOCI_GCP_DOCKER_DOCKER_HOST` to `unix:///var/run/docker.sock` (the container-side path where the socket is always mounted) so Floci can connect to it.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociGcpContainerResource> WithDockerSocket(
        this IResourceBuilder<FlociGcpContainerResource> builder,
        string socketPath = "/var/run/docker.sock")
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociGcpContainerResource>`)
  The `ApplicationModel.IResourceBuilder`1` used to configure the resource.
- `socketPath` (`string`) `optional`
  Optional. Host path to the Docker socket (default: `/var/run/docker.sock`). Non-standard paths (e.g. Podman at `/run/user/1000/podman/podman.sock`) are bind-mounted to `/var/run/docker.sock` inside the container.

## Returns

`IResourceBuilder<FlociGcpContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withDockerSocketGcp`
- Generated method name override: `withDockerSocket`

<a id="withflociui"></a>
<a id="withflociui-iresourcebuilder-flociazurecontainerresource-action-iresourcebuilder-flociuicontainerresource-string"></a>

## WithFlociUI(IResourceBuilder<FlociAzureContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)

- Name: `WithFlociUI(IResourceBuilder<FlociAzureContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAzureContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Azure.cs)

Adds a [Floci UI](https://github.com/floci-io/floci-ui) web console container for browsing the resources hosted by the Floci Azure emulator.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAzureContainerResource> WithFlociUI(
        this IResourceBuilder<FlociAzureContainerResource> builder,
        Action<IResourceBuilder<FlociUIContainerResource>>? configureContainer = null,
        string? containerName = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAzureContainerResource>`)
  The Floci Azure resource builder.
- `configureContainer` (`Action<IResourceBuilder<FlociUIContainerResource>>`) `optional`
  Configuration callback for the Floci UI container resource.
- `containerName` (`string?`) `optional`
  Optional. The name of the Floci UI container (default: `{floci-name}-ui`).

## Returns

`IResourceBuilder<FlociAzureContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further resource configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withFlociUIAzure`
- Generated method name override: `withFlociUI`
- Synchronous exports run on a background thread.

<a id="withflociui-iresourcebuilder-flociawscontainerresource-action-iresourcebuilder-flociuicontainerresource-string"></a>

## WithFlociUI(IResourceBuilder<FlociAwsContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)

- Name: `WithFlociUI(IResourceBuilder<FlociAwsContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAwsContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Azure.cs)

Adds a [Floci UI](https://github.com/floci-io/floci-ui) web console container for browsing the resources hosted by the Floci AWS emulator.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAwsContainerResource> WithFlociUI(
        this IResourceBuilder<FlociAwsContainerResource> builder,
        Action<IResourceBuilder<FlociUIContainerResource>>? configureContainer = null,
        string? containerName = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAwsContainerResource>`)
  The Floci resource builder.
- `configureContainer` (`Action<IResourceBuilder<FlociUIContainerResource>>`) `optional`
  Configuration callback for the Floci UI container resource. Use this to attach additional clouds to the same UI console via `WithReference`.
- `containerName` (`string?`) `optional`
  Optional. The name of the Floci UI container (default: `{floci-name}-ui`).

## Returns

`IResourceBuilder<FlociAwsContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further resource configuration.

## Examples

Use in application host with a Floci resource

```csharp
var builder = DistributedApplication.CreateBuilder(args);

var floci = builder.AddFlociAws("floci")
  .WithFlociUI();

builder.Build().Run();
```

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
- Synchronous exports run on a background thread.

<a id="withflociui-iresourcebuilder-flocigcpcontainerresource-action-iresourcebuilder-flociuicontainerresource-string"></a>

## WithFlociUI(IResourceBuilder<FlociGcpContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)

- Name: `WithFlociUI(IResourceBuilder<FlociGcpContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociGcpContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Azure.cs)

Adds a [Floci UI](https://github.com/floci-io/floci-ui) web console container for browsing the resources hosted by the Floci GCP emulator.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociGcpContainerResource> WithFlociUI(
        this IResourceBuilder<FlociGcpContainerResource> builder,
        Action<IResourceBuilder<FlociUIContainerResource>>? configureContainer = null,
        string? containerName = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociGcpContainerResource>`)
  The Floci GCP resource builder.
- `configureContainer` (`Action<IResourceBuilder<FlociUIContainerResource>>`) `optional`
  Configuration callback for the Floci UI container resource.
- `containerName` (`string?`) `optional`
  Optional. The name of the Floci UI container (default: `{floci-name}-ui`).

## Returns

`IResourceBuilder<FlociGcpContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further resource configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withFlociUIGcp`
- Generated method name override: `withFlociUI`
- Synchronous exports run on a background thread.

<a id="withhostport"></a>
<a id="withhostport-iresourcebuilder-flociuicontainerresource-int"></a>

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

- Name: `WithHostPort(IResourceBuilder<FlociUIContainerResource>, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociUIContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.FlociUI.cs#L52-L57)

Configures the host port that the Floci UI resource is exposed on instead of using a randomly assigned port.

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

## Parameters

- `builder` (`IResourceBuilder<FlociUIContainerResource>`)
  The resource builder for Floci UI.
- `port` (`int?`)
  The port to bind on the host. If `null` is used a random port will be assigned.

## Returns

`IResourceBuilder<FlociUIContainerResource>` -- The resource builder for Floci UI.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withreference"></a>
<a id="withreference-iresourcebuilder-tdestination-iresourcebuilder-flociawscontainerresource"></a>

## WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAwsContainerResource>)

- Name: `WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAwsContainerResource>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<TDestination>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Adds a reference to a Floci AWS emulator resource, injecting the standard `ConnectionStrings__{name}` entry plus the AWS SDK environment variables ( `AWS_ENDPOINT_URL`, `AWS_DEFAULT_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`) so dependent services need no further configuration.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<TDestination> WithReference<TDestination>(
        this IResourceBuilder<TDestination> builder,
        IResourceBuilder<FlociAwsContainerResource> floci)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<TDestination>`)
  The resource builder for the resource receiving the reference.
- `floci` (`IResourceBuilder<FlociAwsContainerResource>`)
  The Floci AWS resource to reference.

## Returns

`IResourceBuilder<TDestination>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withFlociAwsReference`

<a id="withreference-iresourcebuilder-tdestination-iresourcebuilder-flociazurecontainerresource"></a>

## WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAzureContainerResource>)

- Name: `WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAzureContainerResource>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<TDestination>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Adds a reference to a Floci Azure emulator resource, injecting the standard `ConnectionStrings__{name}` entry plus `AZURE_STORAGE_CONNECTION_STRING` -- a development storage connection string carrying the `Blob`, `Queue` and `Table` endpoints so all three Azure Storage SDK clients resolve to the emulator.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<TDestination> WithReference<TDestination>(
        this IResourceBuilder<TDestination> builder,
        IResourceBuilder<FlociAzureContainerResource> floci)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<TDestination>`)
  The resource builder for the resource receiving the reference.
- `floci` (`IResourceBuilder<FlociAzureContainerResource>`)
  The Floci Azure resource to reference.

## Returns

`IResourceBuilder<TDestination>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withFlociAzureReference`

<a id="withreference-iresourcebuilder-tdestination-iresourcebuilder-flociazureservicebusresource-string"></a>

## WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAzureServiceBusResource>, string?)

- Name: `WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAzureServiceBusResource>, string?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<TDestination>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Azure.cs#L199-L222)

Adds a Service Bus connection string reference, using the Docker host gateway for container consumers.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<TDestination> WithReference<TDestination>(
        this IResourceBuilder<TDestination> builder,
        IResourceBuilder<FlociAzureServiceBusResource> serviceBus,
        string? connectionName = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<TDestination>`)
  The resource builder receiving the reference.
- `serviceBus` (`IResourceBuilder<FlociAzureServiceBusResource>`)
  The Service Bus child resource to reference.
- `connectionName` (`string?`) `optional`
  The connection string name, defaulting to the child resource name.

## Returns

`IResourceBuilder<TDestination>` -- The resource builder receiving the reference.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withFlociAzureServiceBusReference`

<a id="withreference-iresourcebuilder-flociuicontainerresource-iresourcebuilder-flociawscontainerresource"></a>

## WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAwsContainerResource>)

- Name: `WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAwsContainerResource>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociUIContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Attaches an additional Floci AWS emulator resource to an existing Floci UI console, so a single console can browse multiple clouds at once instead of creating a UI container per cloud.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociUIContainerResource> WithReference(
        this IResourceBuilder<FlociUIContainerResource> builder,
        IResourceBuilder<FlociAwsContainerResource> cloud)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociUIContainerResource>`)
  The Floci UI resource builder (from the `configureContainer` callback of `WithFlociUI`).
- `cloud` (`IResourceBuilder<FlociAwsContainerResource>`)
  The additional Floci AWS resource to attach.

## Returns

`IResourceBuilder<FlociUIContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withAwsReference`

<a id="withreference-iresourcebuilder-flociuicontainerresource-iresourcebuilder-flociazurecontainerresource"></a>

## WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAzureContainerResource>)

- Name: `WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAzureContainerResource>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociUIContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Attaches an additional Floci Azure emulator resource to an existing Floci UI console, so a single console can browse multiple clouds at once instead of creating a UI container per cloud.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociUIContainerResource> WithReference(
        this IResourceBuilder<FlociUIContainerResource> builder,
        IResourceBuilder<FlociAzureContainerResource> cloud)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociUIContainerResource>`)
  The Floci UI resource builder (from the `configureContainer` callback of `WithFlociUI`).
- `cloud` (`IResourceBuilder<FlociAzureContainerResource>`)
  The additional Floci Azure resource to attach.

## Returns

`IResourceBuilder<FlociUIContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withAzureReference`

<a id="withreference-iresourcebuilder-flociuicontainerresource-iresourcebuilder-flocigcpcontainerresource"></a>

## WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociGcpContainerResource>)

- Name: `WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociGcpContainerResource>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociUIContainerResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Attaches an additional Floci GCP emulator resource to an existing Floci UI console, so a single console can browse multiple clouds at once instead of creating a UI container per cloud.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociUIContainerResource> WithReference(
        this IResourceBuilder<FlociUIContainerResource> builder,
        IResourceBuilder<FlociGcpContainerResource> cloud)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociUIContainerResource>`)
  The Floci UI resource builder (from the `configureContainer` callback of `WithFlociUI`).
- `cloud` (`IResourceBuilder<FlociGcpContainerResource>`)
  The additional Floci GCP resource to attach.

## Returns

`IResourceBuilder<FlociUIContainerResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withGcpReference`

<a id="withreference-iresourcebuilder-tdestination-iresourcebuilder-flocigcpcontainerresource"></a>

## WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociGcpContainerResource>)

- Name: `WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociGcpContainerResource>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<TDestination>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Aws.cs)

Adds a reference to a Floci GCP emulator resource, injecting the standard `ConnectionStrings__{name}` entry plus the `*_EMULATOR_HOST` environment variables the Google Cloud SDKs already honor, along with `GOOGLE_CLOUD_PROJECT` and `CLOUDSDK_CORE_PROJECT`.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<TDestination> WithReference<TDestination>(
        this IResourceBuilder<TDestination> builder,
        IResourceBuilder<FlociGcpContainerResource> floci)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<TDestination>`)
  The resource builder for the resource receiving the reference.
- `floci` (`IResourceBuilder<FlociGcpContainerResource>`)
  The Floci GCP resource to reference.

## Returns

`IResourceBuilder<TDestination>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## ATS metadata

### ATS export

- Capability ID: `CommunityToolkit.Aspire.Hosting.Floci/withFlociGcpReference`

<a id="withservicebus"></a>
<a id="withservicebus-iresourcebuilder-flociazurecontainerresource-string-int-int"></a>

## WithServiceBus(IResourceBuilder<FlociAzureContainerResource>, string, int?, int?)

- Name: `WithServiceBus(IResourceBuilder<FlociAzureContainerResource>, string, int?, int?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAzureServiceBusResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Azure.cs#L106-L180)

Adds a child resource representing the Service Bus AMQP data plane exposed by the Floci Azure emulator, enabling the data plane on the emulator ( `MOCKED=false`, `START_ON_BOOT=true`).

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAzureServiceBusResource> WithServiceBus(
        this IResourceBuilder<FlociAzureContainerResource> builder,
        string name = "servicebus",
        int? amqpPort = null,
        int? amqpTlsPort = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAzureContainerResource>`)
  The Floci Azure resource builder.
- `name` (`string`) `optional`
  The globally unique name of the Service Bus resource (default: `servicebus`). Pass a distinct name for each additional emulator.
- `amqpPort` (`int?`) `optional`
  Host port for plain AMQP (default: selected by the integration at startup).
- `amqpTlsPort` (`int?`) `optional`
  Host port for AMQPS/TLS (default: selected by the integration at startup).

## Returns

`IResourceBuilder<FlociAzureServiceBusResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## Remarks

Reference the returned resource with Aspire's standard `WithReference` API to inject its Service Bus connection string (e.g. for `AddAzureServiceBusClient`). The Artemis sidecar is a separate container floci-az starts via Docker, so the emulator also needs [FlociHostingExtension.WithDockerSocket(IResourceBuilder<FlociAwsContainerResource>, string)](/reference/api/csharp/communitytoolkit.aspire.hosting.floci/flocihostingextension/methods.md#withdockersocket-iresourcebuilder-flociawscontainerresource-string). The integration allocates proxyless AMQP host endpoints when ports are not specified. Requires floci-az 0.12.0 or later. This API is run-only; call it inside an `ExecutionContext.IsRunMode` branch when publishing the AppHost.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withstorage"></a>
<a id="withstorage-iresourcebuilder-flociazurecontainerresource-string"></a>

## WithStorage(IResourceBuilder<FlociAzureContainerResource>, string)

- Name: `WithStorage(IResourceBuilder<FlociAzureContainerResource>, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<FlociAzureStorageResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9c2addac6f527ef2e33712d290b84574b455a3b/src/CommunityToolkit.Aspire.Hosting.Floci/FlociHostingExtension.Azure.cs#L276-L281)

Adds a child resource representing the Blob, Queue and Table Storage APIs exposed by the Floci Azure emulator.

```csharp
public static class FlociHostingExtension
{
    public static IResourceBuilder<FlociAzureStorageResource> WithStorage(
        this IResourceBuilder<FlociAzureContainerResource> builder,
        string name = "storage")
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<FlociAzureContainerResource>`)
  The Floci Azure resource builder.
- `name` (`string`) `optional`
  The name of the Storage resource (default: `storage`).

## Returns

`IResourceBuilder<FlociAzureStorageResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1` for further configuration.

## Remarks

Reference the returned resource with Aspire's standard `WithReference` API to inject its storage connection string (e.g. for `AddAzureBlobServiceClient`). The resource has no health check of its own; it reports the parent emulator's health, so dependents can `WaitFor` it directly.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
