/microsoft-azuresqldb-container:azuresql-db-sidecarfrom Microsoft Azure SQL Database container
Adds an Azure SQL Database container as a sidecar service in Docker Compose or devcontainer.json, including healthcheck, depends_on, and appdb initialization.
Ships in Microsoft Azure SQL Database container. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Wire the container into an existing Docker Compose stack or
Dev Container as a service the app reaches by service name (sqldb,1433),
never localhost. Keep existing services intact; add the database, an init
one-shot that creates appdb, and a depends_on gate.
mcr.microsoft.com/mssql/server. SERVERPROPERTY('EngineEdition')
returns 5, SERVERPROPERTY('Edition') returns 'SQL Azure', and the build
reports as 12.0.2000.8. If you were
about to use the SQL Server image, stop and use this instead.sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest
(x64, linux/amd64). Registry and tag are provisional during Private Preview.docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io using the
shared pull-only credentials provided when you sign up for the Private Preview
at https://aka.ms/sqldbcontainerpreview-signup (they may rotate) before
docker compose up or building the Dev Container.platform: linux/amd64 so the service starts on a non-x64 host.ACCEPT_EULA=Y and a complex MSSQL_SA_PASSWORD (8+ chars,
upper/lower/digit/symbol). Engine listens on 1433.CREATE DATABASE appdb on a master connection before the app connects
with Database=appdb. That is what the sqldb-init one-shot below does.USE to switch databases. In a user-database session (the
Azure-faithful context where you develop), USE returns Msg 40508, exactly
as in Azure SQL Database in the cloud. A master connection is a provisioning
session where the Azure statement filter is not enforced, so USE appears to work there, but master is for provisioning
only, not application work. Always select the target database in the connection
string (Database=appdb, or -d appdb for sqlcmd).SQL_CONNECTION_STRING env var, service name host):
Server=sqldb,1433;Database=appdb;User Id=sa;Password=<sa-password>;TrustServerCertificate=true
(<sa-password> is MSSQL_SA_PASSWORD; the compose and Dev Container files below interpolate it)
(house style spells it User Id=/Password=/Database=; Uid=/Pwd= are
valid synonyms)./docker-entrypoint-initdb.d/*.sql (a
Postgres/MySQL convention, not honored here). Seed in the init one-shot with
sqlcmd -d appdb -i seed.sql AFTER appdb exists.For anything beyond this task (vectors, deeper readiness behavior, full connection model), see the azuresql-db-container skill.
Add these three pieces to your existing compose.yaml. Do not remove or rename
existing services; just add sqldb, sqldb-init, and a depends_on on the app.
services:
# ---- existing services stay exactly as they are ----
sqldb:
image: sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest
platform: linux/amd64 # x64-only image; required on a non-x64 host
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "${MSSQL_SA_PASSWORD:?Set MSSQL_SA_PASSWORD before running Docker Compose}"
SQLCMDPASSWORD: "${MSSQL_SA_PASSWORD:?Set MSSQL_SA_PASSWORD before running Docker Compose}"
ports:
- "127.0.0.1:1433:1433" # optional; only to reach it from this host
healthcheck:
# -b: a SQL error sets the exit code, so transient startup errors
# (e.g. Msg 913) are retried, not masked. -l 2: short login timeout.
test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -C -b -l 2 -Q \"SELECT 1\" || exit 1"]
interval: 5s
timeout: 10s
retries: 30
start_period: 30s
# One-shot: the engine does NOT auto-create databases, so create appdb
# (and seed it) before the app starts. Exits 0 when done.
sqldb-init:
image: sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest
platform: linux/amd64
depends_on:
sqldb:
condition: service_healthy
environment:
SQLCMDPASSWORD: "${MSSQL_SA_PASSWORD:?Set MSSQL_SA_PASSWORD before running Docker Compose}"
# If you have seed.sql, mount it and add: -i /seed/seed.sql on a -d appdb call.
# volumes:
# - ./seed.sql:/seed/seed.sql:ro
entrypoint: ["/bin/bash", "-c"]
command:
- >
/opt/mssql-tools18/bin/sqlcmd -S sqldb -U sa -C -b
-Q "IF DB_ID('appdb') IS NULL CREATE DATABASE appdb;"
restart: "no"
app:
# ---- your existing app service ----
depends_on:
sqldb:
condition: service_healthy
sqldb-init:
condition: service_completed_successfully
environment:
# Host is the SERVICE NAME sqldb, not localhost.
SQL_CONNECTION_STRING: "Server=sqldb,1433;Database=appdb;User Id=sa;Password=${MSSQL_SA_PASSWORD};TrustServerCertificate=true"
Bring it up (after docker login, see above):
docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io # pull-only creds by signing up at https://aka.ms/sqldbcontainerpreview-signup
docker compose pull # refresh the daily-rebuilt :latest (compose reuses a cached image otherwise)
docker compose up -d
docker compose config accepts this file, including the platform override, the escaped
health check and both depends_on conditions, and rejects an unknown condition name. The
engine image ships sqlcmd at /opt/mssql-tools18/bin/sqlcmd, which the health check and
the init one-shot call. After up, the database container shows as Running before it is
healthy, and its health log begins with a failed check.
The image does not auto-run init SQL. To seed, uncomment the volumes mount in
sqldb-init and chain a seed call AFTER appdb is created:
command:
- >
/opt/mssql-tools18/bin/sqlcmd -S sqldb -U sa -C -b
-Q "IF DB_ID('appdb') IS NULL CREATE DATABASE appdb;" &&
/opt/mssql-tools18/bin/sqlcmd -S sqldb -U sa -C -b
-d appdb -i /seed/seed.sql
Use Docker Compose as the Dev Container backend so the same sqldb +
sqldb-init services apply. In .devcontainer/devcontainer.json:
{
"name": "app-with-azuresql",
"dockerComposeFile": "../compose.yaml",
"service": "app", // your dev/app service from compose
"workspaceFolder": "/workspace",
"runServices": ["sqldb", "sqldb-init"],
"remoteEnv": {
"SQL_CONNECTION_STRING": "Server=sqldb,1433;Database=appdb;User Id=sa;Password=${localEnv:MSSQL_SA_PASSWORD};TrustServerCertificate=true"
}
}
Sign in to the registry on the host before "Reopen in Container":
docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io # pull-only creds by signing up at https://aka.ms/sqldbcontainerpreview-signup
The app container reaches the database at sqldb,1433 over the compose network.
sqldb (service name), never localhost.sqldb has a healthcheck using sqlcmd ... -C -b -l 2; the app gates on
condition: service_healthy.sqldb-init creates appdb and is gated by the app via
condition: service_completed_successfully.sqldb and sqldb-init set platform: linux/amd64.User Id= / Password= / Database= and
TrustServerCertificate=true; sqlcmd uses -C.depends_on.mcr.microsoft.com/mssql/server.localhost; inside compose it is the sqldb service.appdb, and do not assume the engine
auto-creates it; the sqldb-init one-shot must run first.USE appdb to switch databases; a user-database session returns
Msg 40508, exactly as in Azure SQL Database in the cloud. Select the target
database in the connection string (Database=appdb, or -d appdb for sqlcmd).--platform / platform: linux/amd64; the image is x64 only./docker-entrypoint-initdb.d/*.sql; it is not honored here.Authoritative, version-pinned references for the tools this skill uses (read the one you need):
If the Microsoft Learn MCP server is configured, use mcp__microsoft-learn__microsoft_docs_search or mcp__microsoft-learn__microsoft_docs_fetch to fetch the current version of any of these on demand. It is optional; when it is unavailable, the references above are authoritative.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
17 skills in this plugin
/azuresql-db-authUse when an app connects to the local Azure SQL Database container as sa: create a least-privilege user, choose auth per environment, keep the connection string out of source (user-secrets, Key Vault)./azuresql-db-ciUse when CI (GitHub Actions, Azure Pipelines, GitLab) runs integration tests against the Azure SQL Database container as a service: health check, registry secrets. For Testcontainers, use `azuresql-db-testing`./azuresql-db-connectionsUse when hardening an app's data layer: connections drop or time out under load, add pooling and retry with backoff for transient faults, Max Pool Size. Also covers the local Azure SQL Database container.npx claudepluginhub microsoft/microsoft-sql --plugin microsoft-azuresqldb-container2 plugins in one repository ship this exact skill · first indexed Nov 26, 2026
Other plugins' skills for the same job