默认 moabukar/miniblue:latest 镜像基于 FROM scratch,不含 docker CLI,使用真实 Docker/k3s 后端需改用二进制安装或 full 构建目标;Terraform 使用前需先执行 scripts/trust-cert.sh 信任证书;默认 HTTP 端口 4566、HTTPS 端口 4567,Terraform 的 metadata_host 需指向 localhost:4567。
miniblue
moabukarMIT活跃维护单二进制本地 Azure 模拟器,无需账号即可跑起 25+ 项 Azure 服务,方便本地开发和 CI 里测试云资源相关代码。
Local Azure development. One binary. No account needed. 25+ emulated services for testing, CI and local dev.
brew tap moabukar/tap && brew install miniblue
docker run -p 4566:4566 -p 4567:4567 moabukar/miniblue:latestREADME 未说明硬件要求;提供约 8MB 的 Docker 镜像,可本地运行,未提及 GPU 或显存需求。
单二进制本地模拟 28 个 Azure 服务,无需账号即可开发和测试 Azure 应用
单二进制本地 Azure 模拟器,无需账号即可跑起 25+ 项 Azure 服务,方便本地开发和 CI 里测试云资源相关代码。
核心能力
- 单端口模拟 28 个 Azure 服务
- 兼容 Terraform、Pulumi、Azure SDK 和 curl
- 可选接入真实 Postgres、Redis 和 Docker 后端
- 支持文件持久化与 Postgres 持久化
- 用 SERVICES 环境变量按需启用服务
容易踩的坑
- v0.8.0最新正式版2026-06-21 · 2026-06-21 22:23 UTC
New: Virtual Machines (
Microsoft.Compute/virtualMachines)Full VM lifecycle backed by real Docker containers, plus multi-service deployment, log streaming, run-command, interactive SSH and managed-identity attestation. miniblue now emulates 28 Azure services.
Virtual Machines
- Create, list, start, stop, restart and delete VMs via the ARM API and
azlocal vm, each backed by a Docker container on a per-VM network (ACI-style stub mode when Docker is absent) - Deploy multiple named services per VM (
azlocal vm deploy), each in its own container with host-published ports and port-conflict detection - Read per-service or combined labelled logs with tail and follow (
azlocal vm logs) - Run one-off commands (
azlocal vm run-command, mirrors Azure runCommand) or open an interactive shell (azlocal vm ssh) - A VM whose container fails to start fails fast with
ContainerStartFailedand persists nothing
Managed identities
- User-assigned managed identities (
Microsoft.ManagedIdentity/userAssignedIdentities) withazlocal identityCRUD - Assign identities to VMs (
azlocal vm identity-assign); workloads inside a VM obtain attestation tokens with no code changes via the standardIDENTITY_ENDPOINT/IDENTITY_HEADERprotocol - Tokens carry
xms_miridand VM claims, verifiable viaPOST /metadata/identity/introspect
Other
- Java SDK example covering Resource Groups, Key Vault, Blob Storage and Cosmos DB (#122)
- Website docs page for Virtual Machines, wired into the nav, services overview and the API parity matrix
- Dependency updates: go-chi/chi v5.3.0, testcontainers-go v0.43.0, alpine 3.24, actions/checkout v7
Full changelog: https://github.com/moabukar/miniblue/blob/main/CHANGELOG.md
- Create, list, start, stop, restart and delete VMs via the ARM API and
- v0.7.02026-05-02 · 2026-05-02 01:28 UTC
查看更新说明
New: Microsoft.Resources/deployments Phase 1 (#118)
az deployment group create --template-file main.bicepnow works end to end against miniblue.What's in Phase 1
PUT/GET/DELETE/ListonMicrosoft.Resources/deployments- Walks
template.resourcesin declaration order - Resolves
[parameters('x')]and[variables('x')](withdefaultValuefallback) - Dispatches each resource through the embedded chi router so existing service handlers apply it
- Per-resource error surfaced as a
Faileddeployment with details
Not yet supported (deferred)
- Other template functions:
[concat()],[resourceId()],[reference()],[copyIndex()], etc. copyloopsconditionon resources- Nested templates and module references
dependsOnordering (resources are applied in declaration order)outputsevaluation- Subscription, management-group, or tenant-scope deployments
What-IfandValidateoperations
See
examples/bicep/for a working sample plus the deferred list.Helm / Kubernetes deployment guide (#117, closes #86)
New page at https://miniblue.io/guides/helm covering
helm install, persistence, PostgreSQL backend via secret, exposing the service, and the in-cluster real-backend limitations.SHA256SUMS for release binaries (#115, closes #94)
The release workflow now publishes a single
SHA256SUMSasset alongside the binaries:sha256sum -c SHA256SUMS --ignore-missingOther
- New AKS CI job that exercises the
:fullDocker image with a mounted docker socket (#114) - CHANGELOG backfilled for v0.4.2 through v0.6.0 from each release's notes (#116)
- README comparison table service count corrected 26 → 27
Upgrading
docker pull moabukar/miniblue:0.7.0 brew upgrade miniblueTry Bicep:
azlocal group create --name bicep-rg --location eastus az deployment group create --resource-group bicep-rg \ --template-file examples/bicep/main.bicep \ --parameters saName=mystorage clusterName=mycluster - v0.6.02026-05-01 · 2026-05-01 18:40 UTC
查看更新说明
New: Azure Kubernetes Service (AKS) emulation (#111, closes #50)
Microsoft.ContainerService/managedClustersARM management plane with two backends:Backend When What works stub (default) always terraform apply,az aks list,azlocal aks ..., mock kubeconfig (kubectl will not connect)real (k3s in Docker) AKS_BACKEND=k3s+ Docker daemoneverything above + a real rancher/k3scluster per AKS resource;kubectl applyactually deploys podsMirrors the ACI Docker pattern, so users do not need to install k3d / kind / minikube.
CLI
azlocal aks create --resource-group RG --name N [--node-count 1] [--kubernetes-version 1.30.0] azlocal aks list --resource-group RG azlocal aks show --resource-group RG --name N azlocal aks delete --resource-group RG --name N azlocal aks get-credentials --resource-group RG --name N [--file PATH|-] [--overwrite-existing]get-credentialsdefaults to merging into~/.kube/configlike realaz aksdoes.Lifecycle coverage
Trigger Cleanup behavior terraform destroy/azlocal aks delete/ directDELETEcontainer removed immediately Resource group cascade delete every cluster's container in that RG removed miniblue SIGTERM/SIGINT/docker stopevery running k3s container torn down before miniblue exits miniblue SIGKILL/ OOM / crashnext start with AKS_BACKEND=k3sreaps orphansPERSISTENCE=1restartmatching containers preserved; same kubeconfig still works New
fullDocker image variantDefault
moabukar/miniblue:lateststays scratch (~9MB). Real-backend users (ACI, AKS) can build thefulltarget which adds the docker CLI:docker build --target=full -t miniblue:full . docker run -v /var/run/docker.sock:/var/run/docker.sock \ -p 4566:4566 -p 4567:4567 -e AKS_BACKEND=k3s miniblue:fullOther changes
- New dedicated CI pipeline
.github/workflows/aks-e2e.ymlthat runs Terraform apply against the AKS example and a real-backend k3s smoke (DinD on the runner) on AKS-touching PRs and push to main - Resource group cascade delete now cleans up child AKS resources properly
cmd/minibluegraceful shutdown propagates to AKS so k3s containers do not leak past miniblue's lifetime- 27 services total (was 26); see
azlocal health
Upgrading
docker pull moabukar/miniblue:0.6.0 brew upgrade miniblueTry it:
azlocal group create --name myRG --location eastus azlocal aks create --resource-group myRG --name dev --node-count 1 azlocal aks list --resource-group myRGKnown limitation
The real backend always runs k3s
v1.30.14. If you PUT a cluster with a differentkubernetesVersionthe ARM response will echo it back butkubectl versionwill report the actual k3s version (aWARNINGlog fires when this happens). Per-version k3s images is on the roadmap for v0.7. - New dedicated CI pipeline
- v0.5.12026-05-01 · 2026-05-01 13:28 UTC
查看更新说明
Bug fixes
- Fix container startup crash on fresh Docker runs. The scratch-based image runs as
USER 65534but had no writable home directory, so miniblue tried tomkdir /.miniblueand failed withpermission denied. The image now ships with/home/nonrootowned by 65534 andHOMEset so the cert dir can be created cleanly. (#110) - Fix cert load when existing certs are unusable. When the cert directory existed but
cert.pem/key.pemwere missing, corrupted, or expired, miniblue wouldlog.Fatalinstead of regenerating. All those branches now fall through to generate a new cert. Thanks @KarasAlison. (#109) - Bump
github.com/go-sql-driver/mysqlto v1.10.0. (#108)
CI
- E2E now builds the image from the PR's
Dockerfileinstead of pulling:latestfrom Docker Hub, so regressions are actually caught on the PR that introduces them. Failed startups also dumpdocker logs minibluefor diagnostics. (#110) - Bump
mislav/bump-homebrew-formula-actionto v4. (#107)
Upgrading
docker pull moabukar/miniblue:0.5.1 # or brew upgrade miniblue - Fix container startup crash on fresh Docker runs. The scratch-based image runs as
- v0.5.02026-04-21 · 2026-04-21 12:41 UTC
查看更新说明
New Azure Services
App Service & Web Apps (#103)
Full emulation of Azure App Service resources, contributed by @abusarah-tech:
- Web Apps (
Microsoft.Web/sites) — CRUD, slots, publishing credentials, config sub-resources (app settings, auth settings v1/v2, connection strings, backup, logs, metadata, push settings, slot config names, storage accounts) - App Service Plans (
Microsoft.Web/serverFarms) — CRUD with SKU tier detection - Container Apps (
Microsoft.App/containerApps) — CRUD, start/stop, revisions, secrets, auth tokens, custom domain analysis, subscription-level listing - Managed Environments (
Microsoft.App/managedEnvironments) — CRUD with app logs configuration - Container App Jobs (
Microsoft.App/jobs) — CRUD, start/stop, executions, detectors, secrets - Name Availability —
CheckNameAvailabilityendpoint for sites - azlocal CLI — New
containerappandcontainerapp envcommands - Terraform examples — New
containerappsandwebappsscenarios
The existing Azure Functions emulation has been refactored into the broader
sitespackage.Bug Fixes
Cert/key loading error handling (#105)
Improved error handling when loading existing TLS certificates and keys, giving clearer error messages when files are corrupted or unreadable. Fixes #104.
Full Changelog: https://github.com/moabukar/miniblue/compare/v0.4.4...v0.5.0
- Web Apps (
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Disclaimer: miniblue is an independent open-source project. It is not affiliated with, endorsed by, or associated with Microsoft or Azure.
Quick Start
# Homebrew
brew tap moabukar/tap && brew install miniblue
# Or Docker
docker run -p 4566:4566 -p 4567:4567 moabukar/miniblue:latest
Then interact with it:
azlocal health
azlocal group create --name myRG --location eastus
azlocal keyvault secret set --vault myvault --name db-pass --value secret123
azlocal storage blob upload --account myacct --container data --name file.txt --data "Hello!"
No Azure account or credentials needed.
What it does
28 Azure services emulated behind a single port. Works with Terraform, Pulumi, Azure SDKs, and curl.
| Service | Service | Service |
|---|---|---|
| Resource Groups | Blob Storage | Table Storage |
| Queue Storage | Key Vault | Cosmos DB |
| Service Bus | Azure Functions | Virtual Networks |
| DNS Zones | Container Registry | Event Grid |
| App Configuration | Managed Identity | DB for PostgreSQL |
| DB for MySQL | Azure SQL Database | Azure Cache for Redis |
| Container Instances | Kubernetes Service (AKS) | Public IP Addresses |
| Network Security Groups | Load Balancer | Application Gateway |
| Storage Accounts | Virtual Machines |
How it compares
| LocalStack (AWS) | MiniStack (AWS) | Azurite (Azure) | miniblue | |
|---|---|---|---|---|
| Services | 80+ | 36 | 3 (storage only) | 28 |
| Docker image | ~1GB | ~200MB | ~300MB | ~8MB |
| Startup | ~10s | ~5s | ~3s | <1s |
| Real backends | DynamoDB Local | RDS, S3, SQS | No | Postgres, Redis, Docker |
| Terraform | Yes | Yes | No | Yes |
| License | BSL | MIT | MIT | MIT |
Terraform
https://github.com/user-attachments/assets/eea72535-6eb7-419d-9f9c-6f42b80d5efc
bash scripts/trust-cert.sh # one-time cert trust
provider "azurerm" {
features {}
metadata_host = "localhost:4567"
skip_provider_registration = true
subscription_id = "00000000-0000-0000-0000-000000000000"
tenant_id = "00000000-0000-0000-0000-000000000001"
client_id = "miniblue"
client_secret = "miniblue"
}
See examples/terraform/ for full examples including three-tier, serverless, and microservices scenarios.
Real Backends (optional)
| Feature | Env var |
|---|---|
| Real PostgreSQL databases | POSTGRES_URL=postgres://user:pass@host:5432/db |
| Real Redis connectivity | REDIS_URL=redis://host:6379 |
| Real Docker containers (ACI) | Docker daemon running |
| Real k3s cluster per AKS resource | AKS_BACKEND=k3s (Docker daemon required) |
| File persistence | PERSISTENCE=1 |
| Postgres persistence | DATABASE_URL=postgres://... |
Real backends shell out to the host Docker daemon. The default moabukar/miniblue:latest image is FROM scratch and has no docker CLI, so use the binary install (Homebrew, releases page) or the full Docker target which adds it:
docker build --target=full -t miniblue:full .
docker run -v /var/run/docker.sock:/var/run/docker.sock \
-p 4566:4566 -p 4567:4567 \
-e AKS_BACKEND=k3s miniblue:full
miniblue tears down its k3s containers on graceful shutdown (SIGTERM/SIGINT/docker stop); orphans from a forced kill are reaped by the next start.
Configuration
| Variable | Default | Description |
|---|---|---|
PORT | 4566 | HTTP port |
TLS_PORT | 4567 | HTTPS port |
LOG_LEVEL | info | debug, info, warn, error |
SERVICES | all | Comma-separated list to enable selectively |
PERSISTENCE | off | Set to 1 for file-based persistence |
Full configuration reference in the docs.
Documentation
Full docs at miniblue.io covering:
- Installation (Homebrew, Docker, binary, Helm)
- Quick Start
- Terraform Guide
- Pulumi Guide
- SDK Guide (Python, Go, JavaScript)
- CLI Reference
- API Parity Matrix
- Architecture
Contributing
See CONTRIBUTING.md. Each service is its own Go package under internal/services/.
Sponsors
miniblue is sponsored by CoderCo.
Want to sponsor this project? Reach out at [email protected].
License
MIT - see LICENSE.