Introducing a new way to review your PRs.

Read the announcement

floci-io / floci-az

Light, fluffy, and always free - Local Azure Emulator

View on GitHub

27 documents · Updated Nov 23, 2026

docs / emulator-console

Emulator console

The emulator console is an optional local browser interface for viewing emulator connection data, service state, and runtime status. floci-az serves a small launch page and starts the full console only when a user asks for it, so normal emulator startup does not depend on the console.

Console access

The console has two browser views. The launch view starts the sidecar and waits for it. The dashboard view gives local users connection and service information without starting the sidecar.

Launch view

GET /_floci/ui starts console launch in the background and returns the launch page at once. The page polls GET /_floci/ui/status; after the console is ready, floci-az redirects the browser to the console's published port. A console that is running but cannot reach floci-az can still be opened from the reported URL.

The launch page stops waiting after about five minutes. It shows a start error when the emulator cannot create the console and offers a retry when the start can be tried again.

References: src/…/UiController.java• L19-25 src/…/UiController.java• L41-47 src/…/index.html• L789-860

Dashboard view

GET /_floci/ui/dashboard serves the local dashboard without starting the console. A browser GET / is mapped to this view when it asks for HTML and has no account host or query. Non-browser requests at /, such as SDK requests that ask for JSON, remain on their normal service route.

References: src/…/UiController.java• L49-58 src/…/AzureRoutingFilter.java• L237-249 src/…/AzureRoutingFilter.java• L320-342 src/…/UiStatusTest.java• L19-35

Console endpoints

The local endpoints separate the emulator's own status from the sidecar's launch state. The dashboard reads these endpoints to show whether the emulator is online, which services are enabled, and whether the console is available.

UI status endpoint

GET /_floci/ui/status returns the console state as JSON. ready means the console answered its readiness probe. url is absent before the console starts, but becomes available as soon as the console has started. error describes a failed start or a console that cannot reach floci-az.

StateMeaning
Enabled but not startedNo console container exists yet. The status is not an error.
Started and checkingThe container runs, but its readiness response is not complete.
ReadyThe console answered its configured readiness probe.
Started with an errorThe console runs or failed to start, but the reported error prevents normal launch.
DisabledConsole start is blocked by FLOCI_AZ_UI_ENABLED=false.

References: src/…/UiController.java• L64-81 src/…/FlociUiManager.java• L51-61 src/…/FlociUiManager.java• L178-206 src/…/UiStatusTest.java• L37-47

Emulator status endpoints

GET /_floci/health and GET /health describe the emulator process and service health. GET /ready is the startup readiness probe for the emulator itself; it returns 503 until startup work is complete and again during shutdown. These endpoints do not mean that the optional console is ready.

The console also reads GET /_floci/info. This manifest identifies the az console profile, the emulator endpoint, the emulator health URL, enabled services, default cloud values, and whether the console is enabled.

References: src/…/HealthController.java• L44-79 src/…/EmulatorInfoController.java• L20-27 src/…/EmulatorInfoController.java• L50-73 src/…/index.html• L639-673

Console readiness

floci-az probes the console over HTTP after it starts. The probe profile matches the selected image so that both the current contract and the built-in older Floci UI image can report readiness.

Probe profiles

Contract v2 consoles answer GET /api/health with {"status":"ok"} when ready. The built-in floci/floci-ui image uses GET /api/clouds/azure/status and reports readiness with {"runtime":"reachable"}. An unavailable response carries the console's reason when it cannot reach floci-az. Other responses mean that the console is still starting rather than failed.

The image choice also controls the browser landing path and endpoint variables. A contract v2 console opens at its root and receives FLOCI_ENDPOINT; the built-in older image opens at /console/azure and uses the Azure-specific endpoint instead.

References: src/…/ConsoleProbe.java• L5-20 src/…/ConsoleProbe.java• L26-40 src/…/FlociUiManager.java• L276-323 src/…/ConsoleProbeTest.java• L35-54

Console environment

The emulator configures the console through container environment values. This gives the console one named emulator, a reachable endpoint, a manifest URL, the listening port, and the Azure defaults needed to show useful connection data.

Endpoint selection

FLOCI_AZ_UI_ENDPOINT is the explicit address that the console uses to reach floci-az. When it is not set, floci-az derives an address that is reachable from the console's Docker network: the emulator's Docker-visible address when floci-az runs in a container, or the Docker host address when floci-az runs on the host. FLOCI_AZ_HOSTNAME is a client-facing name and is not used as this sidecar address.

The console joins the configured emulator service network. The endpoint override is important when Docker runs remotely or when the derived address is not reachable from that network.

References: src/…/FlociUiManager.java• L236-262 src/…/ConsoleEnvironment.java• L34-62 src/…/EmulatorConfig.java• L1246-1250 docs/…/index.md• L58-73

Contract environment

The core console contract uses these values:

VariablePurpose
FLOCI_CLOUDNames the emulator profile as az.
FLOCI_ENDPOINTGives contract v2 consoles the emulator endpoint.
FLOCI_HOSTNAMEGives the console the endpoint host when it can be parsed.
FLOCI_INFO_URLPoints to /_floci/info.
PORTSelects the console's internal listening port.

The Azure profile also supplies the emulator endpoint, default subscription, tenant, location, and storage account. It does not set partial AZURE_* credential variables because those can change how Azure client credential discovery behaves.

References: src/…/ConsoleEnvironment.java• L9-18 src/…/ConsoleEnvironment.java• L40-62 src/…/ConsoleEnvironmentTest.java• L32-69

Console lifecycle

The console lifecycle is independent from the emulator's main request path. floci-az creates and monitors one Docker sidecar on demand, reports failures through the status endpoint, and cleans it up with the emulator unless configured otherwise.

Sidecar startup

On the first launch request, floci-az makes the image available, removes a stale console container, applies the environment and network settings, publishes the configured host port, and starts the container. Repeated launch requests while startup is pending are combined into one start attempt. A failed attempt does not stop the emulator and can be retried.

The default host port is 4500. The internal console port is also 4500 by default. Docker publishes the host port, so the emulator does not need a separate Compose port entry for the console.

References: src/…/FlociUiManager.java• L105-175 src/…/EmulatorConfig.java• L1224-1244 docs/…/index.md• L17-43

Container recovery

Each status read probes the running console. If the container is absent or stopped and the probe did not answer, floci-az clears the old state and starts the console again. If Docker cannot inspect the container, floci-az leaves it alone and keeps reporting the started console as not ready.

References: src/…/FlociUiManager.java• L178-206 src/…/FlociUiManager.java• L264-274 src/…/FlociUiManagerTest.java• L278-313

Shutdown behavior

By default, emulator shutdown stops and removes the console container. FLOCI_AZ_UI_KEEP_RUNNING_ON_SHUTDOWN=true leaves the container running, which lets a separately managed console outlive the emulator process.

References: src/…/FlociUiManager.java• L208-228 src/…/EmulatorConfig.java• L1251-1254 src/…/FlociUiManagerTest.java• L365-384

Console configuration

All console settings use the floci-az.ui configuration group and map to FLOCI_AZ_UI_* environment variables. The image can be the built-in Floci UI or another image that follows Console Contract v2.

VariableDefaultEffect
FLOCI_AZ_UI_ENABLEDtrueAllows launch requests to start the console.
FLOCI_AZ_UI_IMAGEfloci/floci-ui:0.7.0Selects the console image and its probe profile.
FLOCI_AZ_UI_PORT4500Selects the published host port.
FLOCI_AZ_UI_INTERNAL_PORT4500Selects the port inside the sidecar.
FLOCI_AZ_UI_ENDPOINTderivedOverrides how the sidecar reaches floci-az.
FLOCI_AZ_UI_KEEP_RUNNING_ON_SHUTDOWNfalseControls cleanup at emulator shutdown.

When the console is disabled, its page and status endpoint still work. The status reports why it will not start, and the emulator manifest reports ui.enabled=false.

References: src/…/EmulatorConfig.java• L1224-1254 src/…/application.yml• L176-184 src/…/UiDisabledTest.java• L15-76 docs/…/index.md• L45-57

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the console probe path, JSON readiness field, ready value, unavailable value, and landing path aligned with the image selected by FLOCI_AZ_UI_IMAGE.
  • Keep ConsoleEnvironment values aligned with the manifest at /_floci/info, especially the cloud name, endpoint, default subscription, tenant, location, and storage account.
  • Preserve the distinction between the browser's client-facing host and the endpoint that the sidecar can reach over Docker.
  • Keep the direct published-port redirect aligned with the configured host port and the selected console landing path.
  • Keep disabled-console behavior separate from the normal Azure route at /, so JSON SDK requests do not receive the dashboard.

Important failure modes

TriggerConsequenceGuard
The published console port is already in useThe sidecar cannot start and the launch page reports a port errorSet FLOCI_AZ_UI_PORT to another host port.
The sidecar cannot reach the derived emulator endpointThe console runs but never becomes readySet FLOCI_AZ_UI_ENDPOINT to an address reachable from the console network.
The selected image does not use the expected readiness contractThe sidecar stays in the starting state or opens at the wrong pathUse a Console Contract v2 image or preserve the image-specific probe profile.
The console is disabledLaunch requests show the wait page but no container startsSet FLOCI_AZ_UI_ENABLED=true when the console is needed.
Docker cannot pull or start the imageThe emulator remains usable but the console reports a start failureCheck Docker and the image, then retry the launch request.

Key files

FileWhy to read it
src/…/UiController.javaDefines the launch page, dashboard page, status endpoint, and redirect URL.
src/…/FlociUiManager.javaCoordinates sidecar startup, probing, recovery, failure reporting, and shutdown.
src/…/ConsoleProbe.javaDefines readiness and landing behavior for supported console image profiles.
src/…/ConsoleEnvironment.javaDefines the environment contract passed to the console.
src/…/EmulatorInfoController.javaServes the manifest consumed by the console.
src/…/HealthController.javaDefines emulator health and startup readiness responses.
src/…/AzureRoutingFilter.javaDecides when the root browser request becomes the dashboard instead of an Azure service request.
src/…/index.htmlShows the launch and dashboard behavior from the browser's point of view.
src/…/EmulatorConfig.javaDefines the console settings and defaults.
docs/…/index.mdGives the operator-facing console setup and troubleshooting view.