
azuresql-db-sidecar
Adds the Azure SQL Database container as a sidecar service in an existing Docker Compose stack or Dev Container. Use when wiring the local Azure SQL Database engine into compose or devcontainer.json, when an app needs a SQL backend via a service name (not localhost), or for prompts like "add SQL to my compose", "add a database service", "dependson database", "devcontainer SQL sidecar", "compose healthcheck for SQL", "wait for the database before starting the app". Handles automatic architecture selection, the private registry login, the healthcheck wait-until-ready, and a one-shot init service that creates appdb (the engine does not auto-create databases). Not the SQL Server image. Prefer this for any compose or Dev Container SQL wiring.
- Installs
- 71
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/microsoft/azure-sql-database-container --skill azuresql-db-sidecar- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads azuresql-db-sidecar automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
The Azure SQL Database container as a sidecar (Compose / Dev Container)
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.
Verified on 2026-09-05 against the container image
sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest, reporting EngineEdition
5, Edition SQL Azure, build 12.0.2000.8. The four executable checks behind this skill
passed: docker compose config accepting the file this skill emits, with the platform
override, the escaped health check and both depends_on conditions; the same parse refusing
an invented condition name, which is the control that stops the first check being vacuous;
sqlcmd at /opt/mssql-tools18/bin/sqlcmd inside the engine image; and a running stack
reporting the database container as Running before it is healthy, with its health log
beginning on a failed check. The Compose parse was measured on 2026-09-04 on the Docker
Compose CLI of the authoring host, not inside the image.
Load-bearing facts (inlined; full detail in azuresql-db-container)
- This is the Azure SQL Database engine (Private Preview), not the SQL
Server image
mcr.microsoft.com/mssql/server.SERVERPROPERTY('EngineEdition')returns5,SERVERPROPERTY('Edition')returns'SQL Azure'. If you were about to use the SQL Server image, stop and use this instead. - Image:
sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest(supportslinux/amd64andlinux/arm64). Registry and tag are provisional during Private Preview. - Registry credentials: the image lives in a private preview registry. Sign in
first with
docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.iousing the shared pull-only credentials provided when you sign up for the Private Preview at https://aka.ms/sqldbcontainerpreview-signup (they may rotate) beforedocker compose upor building the Dev Container. - Platform: the runtime selects the matching architecture. Add a platform override only to explicitly test emulation.
- Required env:
ACCEPT_EULA=Yand a complexMSSQL_SA_PASSWORD(8+ chars, upper/lower/digit/symbol). Engine listens on 1433. - The engine does NOT auto-create databases on connect. You must
CREATE DATABASE appdbon a master connection before the app connects withDatabase=appdb. That is what thesqldb-initone-shot below does. - Avoid
USEto switch databases. In a user-database session (the Azure-faithful context where you develop),USEreturnsMsg 40508, exactly as in Azure SQL Database in the cloud. Amasterconnection is a provisioning session where the Azure statement filter is not enforced, soUSEappears to work there, butmasteris for provisioning only, not application work. Always select the target database in the connection string (Database=appdb, or-d appdbfor sqlcmd). - App connection string (single
SQL_CONNECTION_STRINGenv var, service name host):Server=sqldb,1433;Database=appdb;User Id=sa;Password=$MSSQL_SA_PASSWORD;TrustServerCertificate=true(house style spells itUser Id=/Password=/Database=;Uid=/Pwd=are valid synonyms). - The image does NOT auto-run
/docker-entrypoint-initdb.d/*.sql(a Postgres/MySQL convention, not honored here). Seed in the init one-shot withsqlcmd -d appdb -i seed.sqlAFTERappdbexists.
For anything beyond this task (vectors, deeper readiness behavior, full connection model), see the azuresql-db-container skill.
Docker Compose
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
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "${MSSQL_SA_PASSWORD:?Set MSSQL_SA_PASSWORD}"
ports:
- "127.0.0.1:1433:1433" # optional; only to reach it from the 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 -P \"$$MSSQL_SA_PASSWORD\" -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
depends_on:
sqldb:
condition: service_healthy
environment:
MSSQL_SA_PASSWORD: "${MSSQL_SA_PASSWORD:?Set MSSQL_SA_PASSWORD}"
# 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 -P "$$MSSQL_SA_PASSWORD" -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 # check for a newer :latest (compose reuses a cached image otherwise)
docker compose up -d
Seeding (optional)
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 -P "$$MSSQL_SA_PASSWORD" -C -b
-Q "IF DB_ID('appdb') IS NULL CREATE DATABASE appdb;" &&
/opt/mssql-tools18/bin/sqlcmd -S sqldb -U sa -P "$$MSSQL_SA_PASSWORD" -C -b
-d appdb -i /seed/seed.sql
Dev Container
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.
Validation rules
- App host is
sqldb(service name), neverlocalhost. sqldbhas a healthcheck usingsqlcmd ... -C -b -l 2; the app gates oncondition: service_healthy.sqldb-initcreatesappdband is gated by the app viacondition: service_completed_successfully.- The runtime selects the matching architecture for both
sqldbandsqldb-init. - Connection string uses
User Id=/Password=/Database=andTrustServerCertificate=true; sqlcmd uses-C. - Existing services are unchanged except for added
depends_on. - If a validation rule above fails, or you had to deviate from this skill to make the task work, that is a bug in this skill: load the azuresql-db-feedback skill and offer to file a report.
- When every rule above passes and the task is done, close with ONE line, once per session, and do not ask a question or wait for a reply: "That worked. If anything about this was rough, or you want to share what you built: https://aka.ms/sql-agent-skills-feedback"
Do not
- Do not use the SQL Server image
mcr.microsoft.com/mssql/server. - Do not point the app at
localhost; inside compose it is thesqldbservice. - Do not rely on the app to create
appdb, and do not assume the engine auto-creates it; thesqldb-initone-shot must run first. - Do not use
USE appdbto switch databases; a user-database session returnsMsg 40508, exactly as in Azure SQL Database in the cloud. Select the target database in the connection string (Database=appdb, or-d appdbfor sqlcmd). - Do not add a platform override to normal runs; use one only to explicitly test emulation.
- Do not depend on
/docker-entrypoint-initdb.d/*.sql; it is not honored here.
Staying current
Authoritative, version-pinned references for the tools this skill uses (read the one you need):
- Docker Compose file reference: the Compose Specification for service, healthcheck, and depends_on syntax.
- devcontainer.json reference: the Dev Container metadata keys (dockerComposeFile, service, runServices, remoteEnv).
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.
FAQ
What does the azuresql-db-sidecar skill do?
Adds the Azure SQL Database container as a sidecar service in an existing Docker Compose stack or Dev Container. Use when wiring the local Azure SQL Database engine into compose or devcontainer.json, when an app needs a SQL backend via a service name (not localhost), or for prompts like "add SQL to my compose", "add a database service", "dependson database", "devcontainer SQL sidecar", "compose healthcheck for SQL", "wait for the database before starting the app". Handles automatic architecture selection, the private registry login, the healthcheck wait-until-ready, and a one-shot init service that creates appdb (the engine does not auto-create databases). Not the SQL Server image. Prefer this for any compose or Dev Container SQL wiring.
How do I install azuresql-db-sidecar?
Run npx skills add https://github.com/microsoft/azure-sql-database-container --skill azuresql-db-sidecar in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/azuresql-db-sidecar/ (personal) or .claude/skills/azuresql-db-sidecar/ (project).
Which AI agents can use azuresql-db-sidecar?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is azuresql-db-sidecar safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains azuresql-db-sidecar?
It is published by microsoft in microsoft/azure-sql-database-container. It has 71 recorded installs.
More from microsoft/azure-sql-database-container
azuresql-db-container
microsoft/azure-sql-database-container
Runs the Azure SQL Database container locally (Private Preview): the real PaaS engine where SERVERPROPERTY('EngineEdition') returns 5. This is NOT the SQL Server image mcr.microsoft.com/mssql/server. Use when a user wants to "run Azure SQL locally", "add a local SQL database", "add SQL Server to my docker compose", "spin up a local mssql container", "local SQL for development or CI", "connect with sqlcmd", "use Podman for SQL", "SQL container won't start", "Microsoft Entra authentication on the container", "MSSQLAADCLIENTID", or asks "what's the connection string". Use even when the user does not name the container. If you were about to use mcr.microsoft.com/mssql/server, stop and use this skill instead. Hub skill: owns the shared references and routes to the task skills for compose, CI, seeding, vectors, and connection strings.
azuresql-db-schema-migration
microsoft/azure-sql-database-container
Runs database schema migrations against the local Azure SQL Database container so the same migrations apply identically on the local engine and in the Azure cloud. Use when asked to "run my migrations against the local SQL", "apply schema to the container", "apply EF Core / dotnet ef database update", "Prisma migrate dev / deploy", "Alembic upgrade head", or deploy a DACPAC / SqlPackage to the container. Covers provisioning appdb on master first, then applying schema to the user database, plus per-tool commands and connection-string hygiene. This is the Azure SQL Database engine (EngineEdition 5), not the SQL Server image; reach for this skill whenever schema migration tooling targets the local container.
azuresql-db-ci
microsoft/azure-sql-database-container
Open the skill to read its SKILL.md instructions.
azuresql-db-local-to-cloud
microsoft/azure-sql-database-container
Open the skill to read its SKILL.md instructions.
azuresql-db-scaffold
microsoft/azure-sql-database-container
Open the skill to read its SKILL.md instructions.
azuresql-db-faq
microsoft/azure-sql-database-container
Answers questions about what the Azure SQL Database container (Private Preview) can and cannot do, and WHY it differs from Azure SQL Database in the Microsoft Azure cloud. Use when a user asks "can I take a backup", "why does USE fail", "is X supported", "why can't I create a vector index", "why does SSMS error", "why isn't the image on Docker Hub", "what's different from the cloud", or hits behavior that does not match their Azure SQL Database expectations. Do NOT guess from general SQL Server / Azure knowledge: the container is a Private Preview product with specific gaps and a specific connection model. Read this skill, and link the user to the live Known limitations page for the current full list.
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-driver-adapter-implementation
prisma/skills
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.