azuresim guide

Overview

azuresim compiles Floci-AZ 0.15.0 together with a semantics and authentication overlay into a single native executable listening on http://127.0.0.1:4577. It emulates Azure Blob Storage and Azure Queue Storage in process without Docker containers, a Java runtime, or external network access.

Architecture and real Azure semantics overlay

The build pipeline (scripts/build.py) verifies the pinned upstream source tarball against upstream.lock.json and applies SHA-256-verified handler overlays (overlay.lock.json) so the emulator matches real Azure Storage behavior expected by official Azure SDKs and lmcloud conformance suites:

Open mode versus SharedKey and Bearer enforcement

By default, azuresim runs in open mode (--auth open), accepting standard development requests against devstoreaccount1. Passing --auth enforce --auth-config auth.json (or setting AZURESIM_AUTH=enforce and AZURESIM_AUTH_CONFIG=auth.json) enables cryptographic and policy enforcement:

Connecting lmazure and Azure SDK clients

Point lmazure at azuresim by calling cloud.set_endpoint("all", "http://127.0.0.1:4577") or exporting LMAZURE_ENDPOINT=http://127.0.0.1:4577. lmazure defaults to LMAZURE_SIM_ACCOUNT=devstoreaccount1 and the standard development SharedKey:

DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:4577/devstoreaccount1;QueueEndpoint=http://127.0.0.1:4577/devstoreaccount1-queue;

Standard lmcode_std_v3 REST and CLI interfaces

LMScript programs running on lmazure against azuresim can use the lmcode_std_v3 REST and CLI interfaces when the installed lmazure ships the 226-signature catalog (check lmazure --lmcode-signatures); these are RestGet..RestOptions, RestHandler, CliCommand, CliOption, rest_config, rest_route, rest_serve, rest_stop, rest_cli:

p = _lmcode_ cli="lmazure" install="github:lmctl-ai/lmazure@latest";
  @"/queues/:queue/dequeue"
  fn pop_msg(x: RestExchange) -> void implements RestPost {
    let list = cloud.queue_receive(x.param("queue"), 1, 30, 0);
    if (list.len() == 0) {
      x.status(204);
      return;
    }
    let m = list.at(0);
    cloud.queue_ack(x.param("queue"), m.receipt());
    x.send(m.body());
  }

  @"--port"
  fn opt_port(x: RestExchange) -> void implements CliOption {
    cloud.set_endpoint("all", "http://127.0.0.1:" + x.query("port"));
  }

  @"enqueue"
  fn cmd_enq(x: RestExchange) -> void implements CliCommand {
    cloud.queue_create("tasks");
    cloud.queue_send("tasks", x.body());
    x.send("enqueued");
  }

  rest_config("prefix", "/v1");
end _lmcode_