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 / azure-storage-services

Azure Storage services

The Blob, Queue, and Table data-plane emulators give local clients Azure-compatible storage behavior. They keep each service's resources in its own state scope while preserving the request, response, concurrency, and lifecycle rules that clients use. The Blob surface also serves Data Lake Gen2 paths, leases, tags, copy actions, and URL-based writes.

Service model

Each service accepts Azure-shaped requests and returns the response form expected by Azure Storage clients. Service state is separate, so equal resource names in different services do not refer to the same resource.

ServiceMain resourceStored itemResponse form
BlobContainerBlob or staged blockXML
QueueQueueMessageXML
TableTableEntityJSON with OData conventions
Data LakeFilesystemFile or directory pathJSON for Data Lake responses

Resources exist apart from their child items. Deleting a resource removes its child data. Reset clears service state used by tests. Transient Blob and Data Lake lease state does not survive an emulator restart. The shared storage model is described in Storage backends.

Request and response compatibility

The handlers map Azure methods, paths, query values, and headers to storage actions. They preserve the response details that clients use to continue a workflow, such as status codes, XML or JSON error envelopes, ETags, continuation headers, service version headers, request IDs, and copy status headers. Blob ETags use the quoted 0x and upper-case hexadecimal form expected by Azure clients.

Unsupported request shapes return an Azure NotImplemented response. This fail-closed behavior is important for multiplexed Blob and Data Lake URLs because an unsupported action must not become a normal content write. Blob, Queue, and Table service-property reads are exposed. Property updates use Azure's accepted response where the service supports that contract.

Blob service

The Blob service manages containers and blob content through the Blob endpoint. It supports normal Blob reads and writes, metadata, conditions, range reads, append blobs, block staging and commit, snapshots, listings, user-delegation key requests, blob index tags, copy operations, and URL-based block and blob writes. It also serves the Data Lake endpoint, so Blob and Data Lake clients use the same path state.

The storage container state also supports the ARM container resource. An ARM create keeps an existing container record and returns its existing ETag and last-modified time. Repeated control-plane creates therefore do not reset Data Lake filesystem properties or resource identity. The control-plane relationship is described in ARM resource governance.

Blob content and resource changes receive Azure-shaped ETags that advance without repeating within one handler instance. Blob reads return the headers that strict clients use to identify content type, size, creation time, encryption, lease state, HTTP properties, and tag count.

Create-only Put Blob requests use Azure's distinct conflict behavior. When If-None-Match: * targets an existing blob, the emulator checks the active lease first and then returns 409 BlobAlreadyExists. Another failed If-None-Match condition keeps the normal 412 ConditionNotMet response.

Append blobs

Append blobs support ordered writes to an existing Blob resource. Each append checks the blob type, expected append position, maximum size condition, and active lease before it changes content. The response reports the prior offset, the new committed block count, the last-modified time, the new ETag, and server-encryption status so a client can track the append sequence and resource version.

References: src/…/BlobServiceHandler.java• L2211-2255 src/…/BlobServiceHandler.java• L2689-2735 src/…/BlobServiceHandler.java• L2959-3015

Blob copy operations

Blob copy operations create a destination from a source blob or snapshot named by x-ms-copy-source. Supported intra-emulator copies complete at once but keep Azure's asynchronous response contract by returning 202 Accepted with a successful copy status and a copy ID. Put Blob From URL is a separate create or replace flow that returns the content-write response. Put Block From URL is a staging flow that copies the source, or a requested source range, into an uncommitted block.

The URL-based write operations do not take a request body. They validate the source path, source authorization, source conditions, and any supplied content checksum before changing the destination. The source can use Azure host-style addressing or an account path. Its URI path is decoded as a path, so encoded names remain distinct from query values. A snapshot query selects a snapshot instead of the live blob. A source SAS is checked as read authorization before the operation starts. Destination metadata, HTTP properties, tags, leases, and conditional writes follow the operation's Azure rules.

References: src/…/BlobServiceHandler.java• L427-453 src/…/BlobServiceHandler.java• L647-840 src/…/BlobServiceHandler.java• L843-1060 src/…/CopySource.java• L14-101

Blob index tags

Blob index tags are a replaceable set of key-value labels attached to a blob. Clients can set them when creating or committing a blob, replace them through comp=tags, read them as Azure XML, and find matching blobs within a container or account.

Tag input accepts URL-encoded header pairs or a Tags XML document. The service allows up to 10 tags, limits key and value lengths, rejects duplicate names and invalid characters, and leaves the existing set unchanged when validation fails. Tag filters use comparisons and grouped and expressions. Find Blobs by Tags also supports the @container value and continuation markers. Conditional writes can use x-ms-if-tags, while tag reads and writes use Blob-specific ETag conditions.

References: src/…/BlobServiceHandler.java• L2497-2653 src/…/BlobServiceHandler.java• L2702-2710 src/…/BlobServiceHandler.java• L3534-3553 src/…/BlobTags.java• L17-26 src/…/BlobTags.java• L67-149 src/…/BlobTagQuery.java• L9-24 src/…/BlobTagException.java• L10-16

Blob leases

Blob leases provide a coordination lock for an existing blob or Data Lake path. The Blob protocol uses PUT ?comp=lease. The Data Lake protocol uses POST with x-ms-lease-action. Both paths address one shared lease, so a client cannot hold separate leases through the two endpoint aliases.

The lease lifecycle supports acquire, renew, change, release, and break actions. Fixed leases last 15 to 60 seconds. Infinite leases have no expiry. A break can leave a lease in a breaking state until its break period ends. Lease state appears in x-ms-lease-status, x-ms-lease-state, and x-ms-lease-duration headers.

Lease checks protect writes, deletes, appends, flushes, access-control changes, and property changes. The lease transition and guarded resource change run as one ordered operation. Deleting a blob, path, container, or filesystem also removes its lease state. Blob errors use XML. Data Lake errors use JSON. Missing or invalid headers produce 400; lease conflicts produce 409; a guarded write without its lease ID produces 412.

References: src/…/BlobLease.java• L17-67 src/…/BlobLeaseService.java• L30-83 src/…/BlobLeaseService.java• L86-212 src/…/BlobLeaseService.java• L229-335 src/…/BlobServiceHandler.java• L423-435 src/…/BlobServiceHandler.java• L297-300

Data Lake paths

The .dfs.core.windows.net route uses Blob service state to model Data Lake Gen2 files, directories, and filesystems. A filesystem is the same scope as a Blob container. Blob and Data Lake clients therefore observe the same paths, content, properties, and lease state.

The Data Lake surface supports filesystem lifecycle, path status, file and directory creation, reads, appends, flushes, deletes, renames, properties, access control, and access checks. Directories can be explicit or implicit when child paths exist. Listings return an exact file when the requested list path names a file. They hide internal staging state and return path names, resource type, time, length, ownership, permissions, and ETags.

Listings support direct-child and recursive modes. Large results continue through x-ms-continuation. The service accepts both its numeric continuation form and the opaque start-from form used by Hadoop ABFS. Non-recursive deletion rejects non-empty directories. Renames check source and destination types, parent paths, conditions, and destination contents before moving a file or directory tree. Unsupported Data Lake actions return Data Lake JSON errors instead of falling through to a Blob write.

Data Lake append data becomes visible after a flush at the requested byte position. Path properties and access-control changes preserve visible metadata and use conditional headers. Resource changes return Azure-shaped ETags. Implicit directories expose a stable synthetic ETag until they become explicit. Permission changes update mode bits without removing named entries from an extended ACL. Access-control and access-check operations require a hierarchical namespace account. Flat accounts return the Azure-compatible disabled-namespace error.

References: src/…/BlobServiceHandler.java• L204-218 src/…/BlobServiceHandler.java• L570-797 src/…/BlobServiceHandler.java• L800-975 src/…/BlobServiceHandler.java• L978-1044 src/…/BlobServiceHandler.java• L1202-1273 src/…/BlobServiceHandler.java• L1308-1509 src/…/BlobServiceHandler.java• L1614-1703 src/…/BlobServiceHandler.java• L1694-1882 src/…/BlobServiceHandler.java• L2142-2208 src/…/BlobServiceHandler.java• L2579-2703 src/…/DataLakePathOperations.java• L40-213

Queue service

The Queue service models queue resources and message visibility rules. It supports queue metadata, stored access policies, queue listing, message enqueue, peek, dequeue, update, delete, and clear operations through Azure XML responses.

A message has an insertion time, expiry time, visibility time, dequeue count, and pop receipt. The default message lifetime is seven days. A message can use -1 to never expire. Enqueue requests can set an initial visibility timeout. A normal dequeue hides the message for 30 seconds unless the client requests another timeout. The service rejects a message lifetime that is not greater than its initial visibility timeout.

The service accepts Update Message with no body as well as with a message body. An empty or whitespace-only body keeps the current message text and only changes visibility. A non-empty body replaces the text. Both forms require the current pop receipt and return a new one, so clients can extend message visibility without resending message content.

A message moves through inspection and consumption states:

  1. Peek returns visible messages without changing their state.
  2. Get Messages returns up to 32 visible messages and changes each returned message's visibility time.
  3. A dequeue increments the count and creates a new pop receipt.
  4. Update Message or Delete Message must present the current pop receipt.

Expired and hidden messages do not appear in reads, deletes, updates, or approximate visible-message counts. Queue listing and message responses use Azure XML shapes, including message IDs, times, pop receipts, and message text.

References: src/…/QueueServiceHandler.java• L199-345 src/…/QueueServiceHandler.java• L361-425 src/…/QueueServiceHandler.java• L427-503 src/…/QueueServiceHandler.java• L522-630 src/…/QueueServiceHandler.java• L651-687

Table service

The Table service manages tables and entities addressed by PartitionKey and RowKey. It exposes JSON responses with OData conventions and mirrors each entity ETag in both the response header and the odata.etag field so different clients can read the concurrency token.

Entity reads support $filter, $select, $top, and continuation headers. The service sorts entities by partition key and row key before it applies paging. A continuation token therefore identifies a position in that ordered query result. Projection always retains the key, timestamp, and ETag fields.

Entity writes support insert, full replacement with PUT, and partial changes with MERGE or PATCH. The service also accepts the X-HTTP-Method form used by clients that tunnel these verbs through POST. If-Match provides optimistic concurrency. The existence check and ETag check run with the write so concurrent requests do not bypass them.

Table names are case-insensitive but retain the spelling used at creation. Entity identity uses both key values without separator collisions. Existing data can be moved from the older key form during service startup. If old tables differ only by case, one accessible table wins and the other remains marked as unreachable so a later restart does not restore it.

A $batch request groups entity changes into one entity-group transaction. If one operation fails, the service restores the earlier entity state. Successful multipart sub-responses omit JSON bodies because some Azure SDKs interpret a JSON body as an error even with a successful status.

References: src/…/TableServiceHandler.java• L98-232 src/…/TableServiceHandler.java• L265-359 src/…/TableServiceHandler.java• L370-713 src/…/TableServiceHandler.java• L719-913 src/…/TableServiceHandler.java• L1052-1181 src/…/TableEntityKeys.java• L22-85 src/…/TableEntityKeys.java• L86-193

Cross-service lifecycle

The three services share a broad request lifecycle while keeping their data in separate scopes. The selected handler applies the rules for its resource and then returns the protocol-specific result.

This diagram shows how an Azure client request reaches one service scope and returns an Azure-shaped response.

flowchart LR
    A[Azure client request] --> B[Core request and auth]
    B --> C{Storage service}
    C --> D[Blob or Data Lake state]
    C --> E[Queue state]
    C --> F[Table state]
    D --> G[Azure-compatible response]
    E --> G
    F --> G

The core layer selects the service handler and checks the request context. The handler resolves the resource, applies service rules such as conditions, visibility, leases, tags, copies, or ETags, and returns the protocol result. Compatibility tests describe the client-facing contract. Storage backends describe the shared persistence boundary.

Compatibility boundaries

Client compatibility depends on more than successful content changes. The emulator must also preserve the response details that Azure SDKs use to continue a workflow.

BoundaryContract that matters
Blob and Data LakeShared path state, range behavior, blob tags, copy and URL-write source parsing, lease headers, conditional failures including create-only Put Blob conflicts, and XML versus JSON errors
QueueInitial and dequeue visibility times, expiry, dequeue count, current pop receipt, metadata, access-policy XML, and body-optional message updates
TableOData field shape, collision-free entity identity, ETags, ordered continuation, tunneled methods, serialized writes, and multipart batch responses
All servicesAzure status codes, request IDs, service version headers, and resource-not-found errors

Change checklist

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

  • If Blob dispatch changes, verify that unsupported comp, action, copy, rename, and URL-write shapes still fail closed instead of overwriting content.
  • If Blob copy or URL-write routing changes, verify host-style and path-style account resolution, URI path decoding, snapshot selection, source SAS and source-condition checks, source ranges, checksums, destination conditions, metadata, tags, leases, and response headers.
  • If Blob tag parsing or storage changes, verify create and block-list tag headers, XML replacement, tag count headers, query matching, continuation markers, and x-ms-if-tags conditions.
  • If Blob tag error handling changes, verify invalid XML, duplicate names, size limits, invalid characters, and malformed filters retain Azure XML error codes and detail elements.
  • If Blob create-only write handling changes, verify If-None-Match: * returns BlobAlreadyExists with 409 after lease validation, while other failed If-None-Match conditions retain 412 ConditionNotMet.
  • If Blob ETag generation changes, verify quoted Azure format, monotonic non-repeating values, conditional writes, lease responses, copy responses, and Data Lake path responses.
  • If Blob and Data Lake lease behavior changes, verify shared lease state, breaking and broken transitions, guarded mutations, and cleanup during resource deletion.
  • If Data Lake path planning changes, verify implicit directories, direct-child and recursive listings, continuation forms, rename trees, and hidden staging records.
  • If Data Lake append or flush behavior changes, verify position checks, contiguous data rules, lease checks, staged-data cleanup, and append response headers.
  • If Data Lake access-control or access-check behavior changes, verify hierarchical namespace gating, both PUT and PATCH request forms, extended-ACL preservation, and reset or account override state.
  • If Data Lake listing or path resolution changes, verify exact-file listings, implicit-directory ETags, path status, and the distinction between visible paths and internal staging records.
  • If ARM container provisioning changes, verify that an existing container keeps its ETag, last-modified time, and Data Lake filesystem properties, while a new container returns the create response.
  • If Queue message fields or response records change, verify enqueue, dequeue, update, and delete still use the current pop receipt and XML field names remain Azure-compatible.
  • If Queue message update handling changes, verify empty or whitespace-only bodies preserve message text, non-empty bodies replace it, visibility is refreshed, and the response returns the new pop receipt.
  • If Queue metadata or access-policy updates change, verify each update preserves the other queue record state and queue deletion does not resurrect it.
  • If Queue visibility, initial visibility, or expiry rules change, verify approximate counts and every message read path use the same visible-message rule and enforce the TTL relationship.
  • If Table entity projection or ordering changes, verify system fields remain present and continuation headers still identify a stable partition-key and row-key position.
  • If Table entity key encoding or startup migration changes, verify distinct PartitionKey and RowKey pairs remain distinct and legacy entities are re-keyed from their stored fields without loss.
  • If Table name normalization or migration changes, verify case-insensitive lookup, created-name listing, collision-loser marking, and entity moves remain consistent.
  • If Table method tunneling changes, verify direct requests and batch changesets resolve the same effective method.
  • If Table write coordination changes, verify existence checks, ETag checks, entity writes, and batch rollback cannot interleave with another writer.
  • If Table batch response construction changes, verify rollback on the first failed operation, failed-operation indexes, and the no-body rule for successful multipart responses.
  • If shared storage scope or reset behavior changes, verify Blob, Queue, and Table state remain isolated and resource deletion removes staged or child state.

Important failure modes

TriggerConsequenceGuard
A multiplexed Blob or Data Lake write is not recognized as a supported actionAn unsupported request can overwrite content or return a false successDispatch handles known actions first and fails closed for unknown shapes
A write or delete reaches a leased Blob or path without the current lease IDThe mutation fails with an Azure lease error instead of changing dataLease validation runs with the guarded mutation as one ordered operation
A flat account sends a Data Lake access-control or access-check requestThe request fails instead of exposing hierarchical namespace behavior on a flat accountThe handler checks the account's hierarchical namespace setting before the operation
A non-recursive delete targets a non-empty Data Lake directoryThe directory and its descendants remainDelete planning requires recursive=true for non-empty directories
A create-only Put Blob targets an existing blobThe request returns 409 BlobAlreadyExists after lease validation instead of replacing contentThe handler treats If-None-Match: * as a create-only condition
A dequeued Queue message uses a stale pop receiptUpdate or delete fails with PopReceiptMismatchDequeue rotates the receipt and later actions compare it exactly
A Queue Update Message request has no body but the service treats the body as requiredA client cannot extend visibility without resending message contentEmpty or whitespace-only bodies preserve the stored text and update only visibility and the pop receipt
A Queue message has a TTL that is not greater than its initial visibility timeoutEnqueue fails with an out-of-range query errorThe service validates both values before it stores the message
A queue metadata or ACL update overwrites the other part of the queue recordExisting metadata or access policy disappearsQueue record rewrites are serialized and preserve the other part
Two Table entities use key text that would collide under separator-only encodingOne entity can hide or replace the otherThe service uses collision-free key encoding and derives legacy migrations from stored keys
A Table name collision differs only by caseOne table becomes inaccessible and a later restart could otherwise restore itStartup migration keeps one winner and marks the other stored record as an unreachable loser
Concurrent Table writes pass an existence or ETag check before another write changes the entityA request can overwrite state that its check did not coverThe handler serializes the check and write, including batch snapshot, execution, and rollback
A Table batch operation fails after earlier operations succeedThe batch must not leave partial entity changesThe service restores the saved entity state before returning the batch error

Key files

FileWhy to read it
src/…/BlobServiceHandler.javaBlob and Data Lake routing, resource lifecycle, ARM container versioning, content operations, URL writes, tags, copies, conditions, listings, hierarchical namespace checks, and response behavior
src/…/BlobEtags.javaAzure-shaped ETag format and non-repeating value generation for Blob and Data Lake changes
src/…/CopySource.javaCopy source URL forms, account resolution, path decoding, snapshots, and source query values
src/…/BlobTagQuery.javaBlob tag filter and conditional-expression rules
src/…/BlobTags.javaBlob tag validation, XML shape, and request-header encoding
src/…/BlobLease.javaLease states, expiry, breaking, and transition rules
src/…/BlobLeaseService.javaShared Blob and Data Lake lease actions, mutation guards, response headers, and cleanup
src/…/DataLakePathOperations.javaData Lake listing, exact-file handling, implicit directory detection, delete planning, and rename planning
src/…/QueueServiceHandler.javaQueue lifecycle, metadata and access policies, message visibility, expiry, dequeue behavior, optional-body updates, and pop-receipt checks
src/…/QueueModels.javaAzure-compatible XML shapes for queues and messages
src/…/TableServiceHandler.javaTable and entity lifecycle, OData queries, ETag checks, method tunneling, serialized writes, and batch atomicity
src/…/TableEntityKeys.javaCollision-free entity identity, case-insensitive table identity, and migration of entities saved with legacy key formats
src/…/TableModel.javaJSON response and batch result shapes used by the Table service
src/…/ODataFilter.javaSupported OData filter expressions and their predicate behavior