Skip to content
DocsTry Aspire
DocsTry

FlociHostingExtension Methods

ClassMethods23 members
Provides extension methods for adding Floci to an Hosting.IDistributedApplicationBuilder.
AddFlociAws(IDistributedApplicationBuilder, string, int?, string, string)Section titled AddFlociAws(IDistributedApplicationBuilder, string, int?, string, string)extensionIResourceBuilder<FlociAwsContainerResource>
Adds a Floci AWS emulator container resource to the Hosting.IDistributedApplicationBuilder.
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")
{
// ...
}
}
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder to which the Floci resource will be added.
namestringThe name of the Floci container resource.
portint?optionalOptional. The host port to bind for the AWS endpoint.
defaultRegionstringoptionalOptional. The default AWS region (default: us-east-1).
defaultAccountIdstringoptionalOptional. The default AWS account ID (default: 000000000000).
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.
AddFlociAzure(IDistributedApplicationBuilder, string, int?)Section titled AddFlociAzure(IDistributedApplicationBuilder, string, int?)extensionIResourceBuilder<FlociAzureContainerResource>
Adds a Floci Azure emulator container resource to the Hosting.IDistributedApplicationBuilder.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAzureContainerResource> AddFlociAzure(
this IDistributedApplicationBuilder builder,
string name,
int? port = null)
{
// ...
}
}
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder to which the Floci resource will be added.
namestringThe name of the Floci container resource.
portint?optionalOptional. The host port to bind for the Azure endpoint.
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.
AddFlociGcp(IDistributedApplicationBuilder, string, int?, string)Section titled AddFlociGcp(IDistributedApplicationBuilder, string, int?, string)extensionIResourceBuilder<FlociGcpContainerResource>
Adds a Floci GCP emulator container resource to the Hosting.IDistributedApplicationBuilder.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociGcpContainerResource> AddFlociGcp(
this IDistributedApplicationBuilder builder,
string name,
int? port = null,
string defaultProjectId = "floci-local")
{
// ...
}
}
builderIDistributedApplicationBuilderThe Hosting.IDistributedApplicationBuilder to which the Floci resource will be added.
namestringThe name of the Floci container resource.
portint?optionalOptional. The host port to bind for the GCP endpoint.
defaultProjectIdstringoptionalOptional. The default GCP project ID (default: floci-local).
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.
WithConfigFile(IResourceBuilder<FlociAwsContainerResource>, string)Section titled WithConfigFile(IResourceBuilder<FlociAwsContainerResource>, string)extensionIResourceBuilder<FlociAwsContainerResource>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAwsContainerResource> WithConfigFile(
this IResourceBuilder<FlociAwsContainerResource> builder,
string hostPath)
{
// ...
}
}
builderIResourceBuilder<FlociAwsContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
hostPathstringThe host-side path to the application.yml file to mount.
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithDataBindMount(IResourceBuilder<FlociAwsContainerResource>, string, bool)Section titled WithDataBindMount(IResourceBuilder<FlociAwsContainerResource>, string, bool)extensionIResourceBuilder<FlociAwsContainerResource>
Configures a bind mount for persistent Floci state.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAwsContainerResource> WithDataBindMount(
this IResourceBuilder<FlociAwsContainerResource> builder,
string source,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<FlociAwsContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
sourcestringThe host path to bind into the container.
isReadOnlybooloptionalWhether the bind mount should be read-only.
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithDataBindMount(IResourceBuilder<FlociAzureContainerResource>, string, bool)Section titled WithDataBindMount(IResourceBuilder<FlociAzureContainerResource>, string, bool)extensionIResourceBuilder<FlociAzureContainerResource>
Configures a bind mount for persistent Floci Azure state.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAzureContainerResource> WithDataBindMount(
this IResourceBuilder<FlociAzureContainerResource> builder,
string source,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<FlociAzureContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
sourcestringThe host path to bind into the container.
isReadOnlybooloptionalWhether the bind mount should be read-only.
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithDataBindMount(IResourceBuilder<FlociGcpContainerResource>, string, bool)Section titled WithDataBindMount(IResourceBuilder<FlociGcpContainerResource>, string, bool)extensionIResourceBuilder<FlociGcpContainerResource>
Configures a bind mount for persistent Floci GCP state.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociGcpContainerResource> WithDataBindMount(
this IResourceBuilder<FlociGcpContainerResource> builder,
string source,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<FlociGcpContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
sourcestringThe host path to bind into the container.
isReadOnlybooloptionalWhether the bind mount should be read-only.
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithDataVolume(IResourceBuilder<FlociAwsContainerResource>, string, bool)Section titled WithDataVolume(IResourceBuilder<FlociAwsContainerResource>, string, bool)extensionIResourceBuilder<FlociAwsContainerResource>
Configures a named data volume for persistent Floci state.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAwsContainerResource> WithDataVolume(
this IResourceBuilder<FlociAwsContainerResource> builder,
string name,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<FlociAwsContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
namestringThe name of the volume to mount.
isReadOnlybooloptionalWhether the volume should be read-only.
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithDataVolume(IResourceBuilder<FlociAzureContainerResource>, string, bool)Section titled WithDataVolume(IResourceBuilder<FlociAzureContainerResource>, string, bool)extensionIResourceBuilder<FlociAzureContainerResource>
Configures a named data volume for persistent Floci Azure state.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAzureContainerResource> WithDataVolume(
this IResourceBuilder<FlociAzureContainerResource> builder,
string name,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<FlociAzureContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
namestringThe name of the volume to mount.
isReadOnlybooloptionalWhether the volume should be read-only.
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithDataVolume(IResourceBuilder<FlociGcpContainerResource>, string, bool)Section titled WithDataVolume(IResourceBuilder<FlociGcpContainerResource>, string, bool)extensionIResourceBuilder<FlociGcpContainerResource>
Configures a named data volume for persistent Floci GCP state.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociGcpContainerResource> WithDataVolume(
this IResourceBuilder<FlociGcpContainerResource> builder,
string name,
bool isReadOnly = false)
{
// ...
}
}
builderIResourceBuilder<FlociGcpContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
namestringThe name of the volume to mount.
isReadOnlybooloptionalWhether the volume should be read-only.
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithDockerSocket(IResourceBuilder<FlociAwsContainerResource>, string)Section titled WithDockerSocket(IResourceBuilder<FlociAwsContainerResource>, string)extensionIResourceBuilder<FlociAwsContainerResource>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAwsContainerResource> WithDockerSocket(
this IResourceBuilder<FlociAwsContainerResource> builder,
string socketPath = "/var/run/docker.sock")
{
// ...
}
}
builderIResourceBuilder<FlociAwsContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
socketPathstringoptionalOptional. 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.
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithDockerSocket(IResourceBuilder<FlociAzureContainerResource>, string)Section titled WithDockerSocket(IResourceBuilder<FlociAzureContainerResource>, string)extensionIResourceBuilder<FlociAzureContainerResource>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAzureContainerResource> WithDockerSocket(
this IResourceBuilder<FlociAzureContainerResource> builder,
string socketPath = "/var/run/docker.sock")
{
// ...
}
}
builderIResourceBuilder<FlociAzureContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
socketPathstringoptionalOptional. 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.
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithDockerSocket(IResourceBuilder<FlociGcpContainerResource>, string)Section titled WithDockerSocket(IResourceBuilder<FlociGcpContainerResource>, string)extensionIResourceBuilder<FlociGcpContainerResource>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociGcpContainerResource> WithDockerSocket(
this IResourceBuilder<FlociGcpContainerResource> builder,
string socketPath = "/var/run/docker.sock")
{
// ...
}
}
builderIResourceBuilder<FlociGcpContainerResource>The ApplicationModel.IResourceBuilder`1 used to configure the resource.
socketPathstringoptionalOptional. 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.
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithFlociUI(IResourceBuilder<FlociAzureContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)Section titled WithFlociUI(IResourceBuilder<FlociAzureContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)extensionIResourceBuilder<FlociAzureContainerResource>
Adds a Floci UI web console container for browsing the resources hosted by the Floci Azure emulator.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAzureContainerResource> WithFlociUI(
this IResourceBuilder<FlociAzureContainerResource> builder,
Action<IResourceBuilder<FlociUIContainerResource>>? configureContainer = null,
string? containerName = null)
{
// ...
}
}
builderIResourceBuilder<FlociAzureContainerResource>The Floci Azure resource builder.
configureContainerAction<IResourceBuilder<FlociUIContainerResource>>optionalConfiguration callback for the Floci UI container resource.
containerNamestring?optionalOptional. The name of the Floci UI container (default: {floci-name}-ui).
IResourceBuilder<FlociAzureContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.
WithFlociUI(IResourceBuilder<FlociAwsContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)Section titled WithFlociUI(IResourceBuilder<FlociAwsContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)extensionIResourceBuilder<FlociAwsContainerResource>
Adds a Floci UI web console container for browsing the resources hosted by the Floci AWS emulator.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociAwsContainerResource> WithFlociUI(
this IResourceBuilder<FlociAwsContainerResource> builder,
Action<IResourceBuilder<FlociUIContainerResource>>? configureContainer = null,
string? containerName = null)
{
// ...
}
}
builderIResourceBuilder<FlociAwsContainerResource>The Floci resource builder.
configureContainerAction<IResourceBuilder<FlociUIContainerResource>>optionalConfiguration callback for the Floci UI container resource. Use this to attach additional clouds to the same UI console via WithReference.
containerNamestring?optionalOptional. The name of the Floci UI container (default: {floci-name}-ui).
IResourceBuilder<FlociAwsContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.

Use in application host with a Floci resource

var builder = DistributedApplication.CreateBuilder(args);
var floci = builder.AddFlociAws("floci")
.WithFlociUI();
builder.Build().Run();
WithFlociUI(IResourceBuilder<FlociGcpContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)Section titled WithFlociUI(IResourceBuilder<FlociGcpContainerResource>, Action<IResourceBuilder<FlociUIContainerResource>>, string?)extensionIResourceBuilder<FlociGcpContainerResource>
Adds a Floci UI web console container for browsing the resources hosted by the Floci GCP emulator.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociGcpContainerResource> WithFlociUI(
this IResourceBuilder<FlociGcpContainerResource> builder,
Action<IResourceBuilder<FlociUIContainerResource>>? configureContainer = null,
string? containerName = null)
{
// ...
}
}
builderIResourceBuilder<FlociGcpContainerResource>The Floci GCP resource builder.
configureContainerAction<IResourceBuilder<FlociUIContainerResource>>optionalConfiguration callback for the Floci UI container resource.
containerNamestring?optionalOptional. The name of the Floci UI container (default: {floci-name}-ui).
IResourceBuilder<FlociGcpContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further resource configuration.
WithHostPort(IResourceBuilder<FlociUIContainerResource>, int?)Section titled WithHostPort(IResourceBuilder<FlociUIContainerResource>, int?)extensionIResourceBuilder<FlociUIContainerResource>
Configures the host port that the Floci UI resource is exposed on instead of using a randomly assigned port.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociUIContainerResource> WithHostPort(
this IResourceBuilder<FlociUIContainerResource> builder,
int? port)
{
// ...
}
}
builderIResourceBuilder<FlociUIContainerResource>The resource builder for Floci UI.
portint?The port to bind on the host. If null is used a random port will be assigned.
IResourceBuilder<FlociUIContainerResource>The resource builder for Floci UI.
WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAwsContainerResource>)Section titled WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAwsContainerResource>)extensionIResourceBuilder<TDestination>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<TDestination> WithReference<TDestination>(
this IResourceBuilder<TDestination> builder,
IResourceBuilder<FlociAwsContainerResource> floci)
{
// ...
}
}
builderIResourceBuilder<TDestination>The resource builder for the resource receiving the reference.
flociIResourceBuilder<FlociAwsContainerResource>The Floci AWS resource to reference.
IResourceBuilder<TDestination>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAzureContainerResource>)Section titled WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociAzureContainerResource>)extensionIResourceBuilder<TDestination>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<TDestination> WithReference<TDestination>(
this IResourceBuilder<TDestination> builder,
IResourceBuilder<FlociAzureContainerResource> floci)
{
// ...
}
}
builderIResourceBuilder<TDestination>The resource builder for the resource receiving the reference.
flociIResourceBuilder<FlociAzureContainerResource>The Floci Azure resource to reference.
IResourceBuilder<TDestination>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAwsContainerResource>)Section titled WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAwsContainerResource>)extensionIResourceBuilder<FlociUIContainerResource>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociUIContainerResource> WithReference(
this IResourceBuilder<FlociUIContainerResource> builder,
IResourceBuilder<FlociAwsContainerResource> cloud)
{
// ...
}
}
builderIResourceBuilder<FlociUIContainerResource>The Floci UI resource builder (from the configureContainer callback of WithFlociUI).
cloudIResourceBuilder<FlociAwsContainerResource>The additional Floci AWS resource to attach.
IResourceBuilder<FlociUIContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAzureContainerResource>)Section titled WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociAzureContainerResource>)extensionIResourceBuilder<FlociUIContainerResource>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociUIContainerResource> WithReference(
this IResourceBuilder<FlociUIContainerResource> builder,
IResourceBuilder<FlociAzureContainerResource> cloud)
{
// ...
}
}
builderIResourceBuilder<FlociUIContainerResource>The Floci UI resource builder (from the configureContainer callback of WithFlociUI).
cloudIResourceBuilder<FlociAzureContainerResource>The additional Floci Azure resource to attach.
IResourceBuilder<FlociUIContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociGcpContainerResource>)Section titled WithReference(IResourceBuilder<FlociUIContainerResource>, IResourceBuilder<FlociGcpContainerResource>)extensionIResourceBuilder<FlociUIContainerResource>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<FlociUIContainerResource> WithReference(
this IResourceBuilder<FlociUIContainerResource> builder,
IResourceBuilder<FlociGcpContainerResource> cloud)
{
// ...
}
}
builderIResourceBuilder<FlociUIContainerResource>The Floci UI resource builder (from the configureContainer callback of WithFlociUI).
cloudIResourceBuilder<FlociGcpContainerResource>The additional Floci GCP resource to attach.
IResourceBuilder<FlociUIContainerResource>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.
WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociGcpContainerResource>)Section titled WithReference(IResourceBuilder<TDestination>, IResourceBuilder<FlociGcpContainerResource>)extensionIResourceBuilder<TDestination>
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.
public static class FlociHostingExtension
{
public static IResourceBuilder<TDestination> WithReference<TDestination>(
this IResourceBuilder<TDestination> builder,
IResourceBuilder<FlociGcpContainerResource> floci)
{
// ...
}
}
builderIResourceBuilder<TDestination>The resource builder for the resource receiving the reference.
flociIResourceBuilder<FlociGcpContainerResource>The Floci GCP resource to reference.
IResourceBuilder<TDestination>A reference to the ApplicationModel.IResourceBuilder`1 for further configuration.