Build, packaging, and configuration
floci-az uses Maven and Quarkus to build a JVM application or native executable that runs an Azure-compatible local emulator. Runtime settings choose the emulator endpoint, state model, security mode, services, and access to Docker-backed data planes. Docker images and Compose provide repeatable runs, while azfloci connects the Azure CLI to the local Storage endpoints.
System model
Build and run paths
The repository supports three paths from source to a running emulator:
- Maven compiles and tests the Quarkus application.
- A JVM or native build supplies the application to a container image.
- A local process or Docker Compose starts the emulator on HTTP port
4577.
The local build and installation guide covers developer commands. The Docker Compose and image guide covers image use and container topology. The application configuration reference covers the full YAML and environment-variable surface.
This diagram shows how source and build outputs become a local service.
flowchart LR
Source["Java source and resources"] --> Maven["Maven / Quarkus build"]
Maven --> JVM["JVM application"]
Maven --> Native["Native executable"]
JVM --> JVMImage["JVM image"]
Native --> NativeImage["Native image"]
JVMImage --> Compose["Docker Compose or Docker"]
NativeImage --> Compose
JVM --> Local["Local Quarkus run"]
Native --> Local
Compose --> Emulator["floci-az on port 4577"]
Local --> Emulator
References: pom.xml• L5-24 Makefile• L102-121 docker-compose.yml• L1-24
Maven build
Maven project
The Maven project is the build authority for the emulator. It defines release version 0.17.0, targets Java 25 for the main application, and uses the Quarkus platform to build the application, generate code, run tests, and prepare native-image support. The Service Bus compatibility extensions compile against Java 21. The native profile enables native output and integration tests.
Maven also carries the versioned inputs and build steps for the Service Bus compatibility layer. The Artemis and Proton versions are coupled to the Artemis sidecar image, and Maven packages the compatibility patches with the application. A change to one of these versions therefore affects both the application build and the sidecar image contract.
The project defines Checkstyle settings for the emulator's main source tree. These checks are separate from the application runtime and do not change the image contract.
References: pom.xml• L5-27 pom.xml• L179-196 pom.xml• L543-592 pom.xml• L623-644
Build modes
The main build choices are:
| Mode | Purpose | Main output or use |
|---|---|---|
| Compile | Fast source validation | Compiled application classes |
| JVM package | Developer and compatibility test runs | target/quarkus-app |
| Native package | Small image and fast startup | Native runner executable |
| Test | Unit and integration confidence | Maven test reports |
The package-only JVM image expects a completed Maven package. The full JVM Docker build performs that package step in its build stage. Native builds use the native profile and can run integration tests against the native runner.
References: pom.xml• L179-196 pom.xml• L594-622 pom.xml• L648-661 Makefile• L104-105 Makefile• L144-147 docker/Dockerfile• L1-14 docker/Dockerfile.jvm-package• L27-35
Runtime configuration
Configuration sources
src/…/application.yml is the default configuration for the running application. The floci-az section defines emulator behavior, and environment variables override YAML values by changing dots to underscores and using uppercase letters. For example, floci-az.storage.mode becomes FLOCI_AZ_STORAGE_MODE.
References: src/…/application.yml• L43-57 src/…/EmulatorConfig.java• L9-50 AGENTS.md• L169-180
Configuration is grouped by the system concern it controls:
| Group | Role |
|---|---|
| Core and TLS | Port, returned base URLs, host name, and HTTP/HTTPS behavior |
| Storage | Global state mode, state path, flush timing, and service overrides |
| Docker and DNS | Docker access, child-container naming, log limits, and name resolution |
| Services | Service enablement, sidecar choice, ports, images, and service limits |
| Authentication | Development or signature-checking behavior |
| Native and browser access | Native resource setup and cross-origin browser requests |
Parity controls how closely the emulator follows Azure when local behavior differs. The compat mode preserves established emulator behavior. azure enables Azure parity overrides, while strict also enables Azure refusal rules; individual overrides can opt in to selected behavior. Cloud and directory settings provide default tenant and subscription context for management and identity flows. These settings let a run choose compatibility behavior and its Azure cloud context without changing the build.
References: src/…/application.yml• L97-162 src/…/EmulatorConfig.java• L109-138
The emulator ships a generated cloud catalog for Azure public, US Government, and China environments. The catalog supplies cloud-specific management, identity, Graph, portal, location, and service-suffix values to clients and management flows. A generated provider catalog supplies the ARM namespaces, resource types, and API versions that the emulator advertises. A generated role catalog supplies Azure built-in role definitions for the authorization service.
References: src/…/clouds.json• L24-46 src/…/clouds.json• L701-729 src/…/clouds.json• L1038-1067 src/…/clouds.json• L1405-1500 src/…/providers.json• L1-15 src/…/role-definitions.json• L1-10
The default application setup uses port 4577, memory storage, plain HTTP, development authentication, and permissive CORS for local browser clients. Compose overrides this baseline by enabling TLS and setting the container hostname. Native builds include the bundled Azure, Artemis, and web-console resources. They also use run-time initialization for components that need it at startup. See the runtime configuration path for the complete setting reference.
References: src/…/application.yml• L1-41 src/…/application.yml• L43-57 src/…/application.yml• L190-198 src/…/EmulatorConfig.java• L496-500 docker-compose.yml• L13-17
State and service controls
Storage mode defines how long emulator state survives. memory favors fast and disposable runs. persistent, hybrid, and wal add disk-backed state with different write and recovery behavior. A service can override the global mode, so one emulator process can support both disposable and durable service state. See the storage backends guide for the state model.
References: src/…/application.yml• L53-95 src/…/EmulatorConfig.java• L52-107
Service settings separate service availability from the choice of a real Docker-backed data plane. This lets a run keep management behavior while omitting a sidecar. The default profile runs Event Hubs with a real Artemis data plane, enables Azure AI Search management-plane resources, keeps Service Bus broker startup opt-in, enables real containers for Functions and several data services, and leaves many other data planes in mocked mode.
SQL now defaults to no live data-plane provider. Its older mocked value remains a compatibility alias for selecting no provider or the managed provider. Azure Container Instances defaults to mocked management state, while setting aci.mocked to false enables real container groups backed by shared-network-namespace pods.
References: src/…/application.yml• L200-343 src/…/EmulatorConfig.java• L375-442 src/…/EmulatorConfig.java• L507-549
Web console
The web console provides a browser view of the running emulator without changing the main management endpoint. It is enabled by default and starts its own container on demand when a user opens /_floci/ui; the console uses port 4500 and reaches the emulator through the configured endpoint. See the emulator console guide for the user flow.
References: src/…/application.yml• L190-198 docker-compose.yml• L6-18
Network and security settings
The returned base URL and optional hostname control the addresses that clients receive. This matters when a client runs in another container because the address must resolve from that client. Compose uses the hostname floci-az for this reason. These endpoint and auth choices also shape the core routing and authentication flow.
References: src/…/EmulatorConfig.java• L15-40 docker-compose.yml• L12-20
TLS is optional on the main port. When enabled, the emulator can accept HTTP and HTTPS on the same listener and can also bind the configured HTTPS port 443. The default certificate is self-signed when no certificate paths are supplied, so certificate-checking clients must trust the generated certificate or use a local transport setting.
References: src/…/application.yml• L43-52 src/…/EmulatorConfig.java• L752-782
Docker packaging
Image forms
The image set supports different points in the development and release lifecycle:
| Image path | Role |
|---|---|
docker/Dockerfile | Builds the JVM application and creates a runtime image in one operation |
docker/Dockerfile.jvm-package | Packages an already-built JVM application for local compatibility runs |
docker/Dockerfile.native | Builds and packages a native executable for the current target |
docker/Dockerfile.native-package | Packages a supplied native executable for release or CI image creation |
docker/Dockerfile.compat | Adds the Azure CLI and azfloci to a published emulator image |
The native path is the usual release form because it gives a small image and fast startup. The JVM path is useful when the local loop should avoid a native build. See the image and Compose guide for commands and image choices.
References: docker/Dockerfile• L1-14 docker/Dockerfile.jvm-package• L1-7 docker/Dockerfile.native• L1-15 docker/Dockerfile.native-package• L1-9 docker/Dockerfile.compat• L1-22
All runtime forms expose 4577, use /app/data as the container state volume, provide a health check, and start through the common entrypoint. The entrypoint prepares access to a mounted Docker socket and then runs the application as the unprivileged floci user.
References: docker/Dockerfile• L37-57 docker/Dockerfile.jvm-package• L27-63 docker/Dockerfile.native• L44-75 docker/Dockerfile.native-package• L31-66 docker/entrypoint.sh• L1-40
Compose topology
The repository Compose file is a development stack for the native image. It publishes 4577, mounts local ./data for state, mounts the host Docker socket for child containers, enables TLS, and places the emulator on the named floci_az_default network. The network name is passed to the emulator so sidecar containers can reach one another by Docker name. The web console publishes its own port 4500 when it starts, so the main service does not add that port to its mapping.
References: docker-compose.yml• L1-25
Docker-backed services run as child containers managed by the emulator. Their data-plane ports are allocated separately from the main HTTP port, so they are not normally added to the Compose ports list for floci-az. A mounted Docker socket is therefore required for Functions and for any enabled service that needs a sidecar.
References: src/…/application.yml• L164-188 docker-compose.yml• L6-20 AGENTS.md• L67-80
Release inputs
Version and changelog flow
The release process uses Conventional Commit messages as its source for release intent. semantic-release analyzes commits on main, computes the next version, updates the Maven version, generates CHANGELOG.md, creates the release commit and tag, and publishes the GitHub release. The release configuration keeps the Maven project file and changelog in the generated release commit.
References: .releaserc.json• L1-33 CHANGELOG.md• L1-5 AGENTS.md• L385-394
CHANGELOG.md is an output of the release process rather than a normal hand-edited history file. A manual change needs an explicit repository exception because it can conflict with the generated changelog policy.
References: .releaserc.json• L9-14 .releaserc.json• L22-30 CHANGELOG.md• L1-3
Image release channels
Release packaging uses the native image as the published emulator image and provides a compatibility image with the Azure CLI and azfloci included. Version tags link the Maven release to the image release. The published Artemis sidecar tag must also match the protocol artifact versions selected in the Maven build.
References: .releaserc.json• L17-32 pom.xml• L17-22 src/…/application.yml• L245-299 docker/Dockerfile.native-package• L1-9 docker/Dockerfile.compat• L1-25
azfloci command-line workflow
CLI handoff
azfloci is a small Python launcher around the installed Azure CLI. It does not replace az; it prepares a local Storage connection string, adjusts the environment for local HTTP use, and forwards the original command to the real CLI.
The normal workflow is:
- Start the emulator on
localhost:4577. - Run
azfloci setupto print the development connection string and an alias suggestion. - Run Azure CLI Storage commands through
azfloci, or use the suggested alias. - Add
--account-namewhen a non-default storage account is needed.
This sequence shows where the wrapper ends and the official CLI begins.
sequenceDiagram
participant User
participant Wrapper as azfloci
participant AzureCLI as az
participant Emulator as floci-az :4577
User->>Wrapper: Storage command
Wrapper->>Wrapper: Select account and local connection string
Wrapper->>AzureCLI: Forward command with environment
AzureCLI->>Emulator: Azure Storage request
Emulator-->>AzureCLI: Azure-compatible response
AzureCLI-->>User: Command result
The wrapper injects AZURE_STORAGE_CONNECTION_STRING only when the caller has not supplied one or passed --connection-string. It defaults the account to devstoreaccount1, points Blob, Queue, and Table endpoints at the local port, and leaves other caller environment values in place. The official Azure CLI must be installed unless the command runs in the compatibility image, which includes both tools.
References: azfloci/azfloci.py• L6-18 azfloci/azfloci.py• L28-53 docker/Dockerfile.compat• L11-25
Change checklist
When these files or sections are changed, remember to consider these:
- If the HTTP port or returned hostname changes, keep application.yml, the Makefile health wait, image health checks, Compose port mapping, and the
azflociconnection string aligned. - If storage paths or defaults change, update the
/app/dataimage volume and the Compose./datamount together. Check the separate host path used when child containers need to see the same files. - If a service changes from mocked to Docker-backed mode, check the Docker socket, shared network, sidecar image, allocated port range, and client-visible endpoint as one contract.
- If parity, cloud, tenant, or subscription defaults change, check management, identity, and client endpoint assumptions together.
- If the cloud catalog changes, check the endpoint and suffix values used by cloud-aware clients and management flows for all supported cloud names.
- If the provider catalog changes, check ARM provider discovery and API-version matching for the affected resource types.
- If the role catalog changes, check built-in role lookup and authorization responses for role IDs and permission sets.
- If SQL data-plane selection, Service Bus broker startup, or ACI defaults change, keep compatibility aliases, sidecar needs, and compatibility-test skip behavior aligned.
- If native-image-sensitive startup behavior changes, review the native initialization settings in application.yml with the native Docker build.
- If the console image, endpoint, or port changes, keep the on-demand UI route, Docker network, and console port behavior aligned.
- If release metadata changes, keep the Maven version update, generated changelog assets, Conventional Commit policy, and image tag inputs consistent.
- If the Storage endpoint shape or account key changes, update
azflociand example connection strings at the same time. - If the Java, Quarkus, Artemis, or Proton build inputs change, keep the native profile, Service Bus compatibility artifacts, and matching sidecar image contract aligned.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
docker/Dockerfile.jvm-package runs before Maven creates target/quarkus-app | The image build cannot package the application or may package stale output | Use the compatibility build path, which packages with Maven first |
| A Docker-backed service runs without a usable Docker socket or shared network | The management surface can start while sidecar data-plane work fails | Mount the socket and set the service Docker network, or keep that service in mocked mode |
| Compose enables TLS while a client trusts only plain HTTP or the system CA set | Client requests fail during connection or certificate validation | Use the HTTPS endpoint and trust the generated certificate, or disable TLS for that run |
The emulator uses memory storage without a state volume | State disappears when the process or container stops | Select a disk-backed mode and mount /app/data |
| SQL expects a live data plane while its provider remains unset | Management operations succeed but database requests have no live SQL endpoint | Select the managed provider and meet its EULA and container requirements |
| A native image omits required crypto runtime initialization | Key Vault encryption or signature checks fail only after native startup | Build with the current native settings and run the native crypto smoke check against the live image |
| Cloud metadata points a client to the wrong endpoint or suffix | Cloud-aware login, ARM, Graph, or service URL requests target the wrong environment | Keep cloud names, endpoint families, locations, and suffixes aligned in the catalog |
| Provider metadata omits a required namespace, resource type, or API version | ARM discovery or a client request reports an unsupported resource contract | Update the generated provider catalog from its source when the supported API surface changes |
| A built-in role entry has the wrong ID or permission set | Authorization lookup returns the wrong role or cannot resolve a known Azure role | Regenerate the role catalog from its source dataset |
| A release commit does not follow Conventional Commits | semantic-release may not select the intended version change or release notes | Use the repository's Conventional Commit format |
azfloci cannot find the real az executable | The wrapper exits before sending a command | Install Azure CLI or use the compatibility image |
Key files
| File | Why to read it |
|---|---|
| pom.xml | Maven project version, Java and Quarkus build, tests, native profile, source checks, and Service Bus build inputs |
| src/…/application.yml | Default runtime settings for ports, TLS, parity, cloud context, storage, Docker, DNS, authentication, native startup, UI, and services |
| src/…/clouds.json | Cloud-specific endpoints, locations, authentication hosts, and service suffixes |
| src/…/providers.json | ARM provider namespaces, resource types, and API versions advertised by the emulator |
| src/…/role-definitions.json | Azure built-in role definitions used by the authorization service |
| src/…/EmulatorConfig.java | Configuration contract and default values used by the application |
Makefile | Local build, start, health wait, Docker compatibility, and cleanup paths |
| docker-compose.yml | Compose topology and default native-image run settings |
docker/Dockerfile | Complete JVM image build path |
docker/Dockerfile.native | Native image build and runtime path |
docker/Dockerfile.jvm-package | Package-only JVM image used by the local compatibility loop |
docker/Dockerfile.native-package | Package-only native image used for CI or release inputs |
docker/Dockerfile.compat | Compatibility image that combines the emulator with Azure CLI tooling |
| docker/entrypoint.sh | Container startup boundary for data ownership and Docker socket access |
| azfloci/azfloci.py | Local Azure CLI handoff and Storage connection-string behavior |
| .releaserc.json | semantic-release inputs and generated release assets |
| docs/…/installation.md | Practical local build and image commands |
| docs/…/docker-compose.md | Compose scenarios and environment-variable use |
| docs/…/application-yml.md | Detailed YAML configuration reference |
| docs/emulator-console.md | Web-console startup and access flow |