/azure-sql-database-container:azuresql-db-connectionsfrom azure-sql-database-container
Configures connection pooling and retry/transient-fault handling for apps targeting Azure SQL Database (local container or cloud). Use when hardening data-access layers against dropped connections, timeouts, or throttling.
Ships in 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.
Read when SKILL.md points to them.
Make the app's database connections reliable with connection pooling and retry / transient-fault handling. This is the Azure SQL engine (Private Preview), not the SQL Server image.
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. All five executable checks behind this skill
passed: the engine identity, Msg 40508 for USE, a TCP session on the mapped port, and the
two resource-governance dynamic management views returning nothing locally. Of the ten
transient error numbers in the retry list below, nine are in this build's sys.messages and
Msg 10929 is not. It stays in the list because it is a cloud resource-governance error the
container has no reason to raise, and it is sourced from Microsoft Learn rather than from that
run.
The local container rarely drops a connection, so it is tempting to skip pooling and retry. Do not. Azure SQL Database in the cloud throttles and drops connections during failovers, scaling, and load; a client with no retry surfaces those as hard errors. Build pooling and retry now, against the local container, and the same code survives in the cloud with no rewrite. For the full promote-to-cloud story see the azuresql-db-local-to-cloud skill.
Verify identity once running: SELECT SERVERPROPERTY('EngineEdition') returns 5 and
SERVERPROPERTY('Edition') returns 'SQL Azure'. For full engine detail see the
azuresql-db-container skill.
The container does not carry the throttling telemetry the cloud does, so do not write a local
diagnostic against it. sys.dm_db_resource_stats and sys.dm_user_db_resource_governance are
absent from this engine: OBJECT_ID returns NULL for both, and a query against either
does not run at all here. Their absence is not evidence that the cloud does not throttle. It is
the reason the retry policy below has to be built without being able to provoke the fault
locally.
sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest
(multi-architecture: linux/amd64 and linux/arm64, Private Preview registry). Sign in first:
docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io with the shared pull-only credentials
from https://aka.ms/sqldbcontainerpreview-signup (they may rotate). The runtime
selects the matching architecture; use a platform override only to explicitly
test x64 emulation.mcr.microsoft.com/mssql/server (the SQL Server image).ACCEPT_EULA=Y and a complex MSSQL_SA_PASSWORD (example literal:
YourStr0ng_Passw0rd). The engine listens on 1433.CREATE DATABASE appdb on a master
connection first. Do not USE to switch databases: a user-database session returns
Msg 40508. Select the database in the connection string (Database=appdb).SQL_CONNECTION_STRING. Strings use User Id= / Password= /
Database= and TrustServerCertificate=true. sqlcmd uses -C.HOST_PORT=1433; while lsof -nP -iTCP:"$HOST_PORT" -sTCP:LISTEN >/dev/null 2>&1; do HOST_PORT=$((HOST_PORT+1)); done
MSSQL_SA_PASSWORD="${MSSQL_SA_PASSWORD:-Aa1%$(openssl rand -hex 16)}"
docker rm -f sqldb 2>/dev/null
docker run -d --name sqldb -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=$MSSQL_SA_PASSWORD" \
-p "127.0.0.1:$HOST_PORT:1433" sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest
until docker exec sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$MSSQL_SA_PASSWORD" -C -b -l 2 \
-Q "IF DB_ID('appdb') IS NULL CREATE DATABASE appdb;" >/dev/null 2>&1; do sleep 2; done
echo "ready on localhost,$HOST_PORT"
The canonical string the app consumes (replace 1433 with the chosen HOST_PORT if 1433 was
occupied):
Server=localhost,1433;Database=appdb;User Id=sa;Password=$MSSQL_SA_PASSWORD;TrustServerCertificate=true
Max Pool Size (default 100 in .NET) so a spike cannot open unlimited
connections. Size it to real concurrency, not a guess.Min Pool Size keeps a few connections warm and cuts cold-start latency.using / with / context managers) so they return
to the pool instead of leaking.Retry only a transient fault: throttling, a brief failover, a dropped idle connection. In Azure SQL these arrive as specific error numbers: 40501 throttling, 40613 database unavailable, 49918/49919/49920 busy, 4060, 10928, 10929, 40197, 233, plus connection-timeout and broken-pipe socket errors.
INSERT that committed before the
connection dropped. Use client-generated keys, MERGE, or a transaction the retry re-runs as a
whole. EF Core's execution strategy handles this when the work goes through its
Execute/transaction API.EnableRetryOnFailure for .NET). Hand-roll only for raw drivers.Open references/retry-snippets.md when you are wiring one of these stacks; it carries copy-pasteable pooling config and transient-only retry for each:
Microsoft.Data.SqlClient): pooling keywords (Max Pool Size, Min Pool Size,
Pooling=true) and connection-string retry keywords (ConnectRetryCount,
ConnectRetryInterval); plus EF Core EnableRetryOnFailure (the SqlServer execution
strategy).mssql / tedious): pool config (max / min / idleTimeoutMillis) and a
transient-error retry wrapper.pyodbc): connection reuse and a tenacity retry decorator that retries only
transient ODBC errors.Keep the single SQL_CONNECTION_STRING contract: pooling and retry are tuned in code and in
driver-specific keywords, not by inventing new env vars.
MERGE, or a retriable transaction).Max Pool Size; connections are disposed and returned to
the pool, never opened per query.SQL_CONNECTION_STRING.EngineEdition 5; appdb was created on a master
connection before the app connected.MERGE, or a retriable
transaction).SQL_CONNECTION_STRING contract.sys.dm_db_resource_stats or sys.dm_user_db_resource_governance; neither view exists on this engine.mcr.microsoft.com/mssql/server SQL Server image.EnableRetryOnFailure), Node (mssql/tedious pool + retry wrapper), and Python (pyodbc reuse + tenacity decorator). Read the section for your stack.Authoritative, version-pinned references for the tools this skill uses (read the one you need):
EnableRetryOnFailure and execution strategies.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
npx claudepluginhub microsoft/azure-sql-database-container --plugin azure-sql-database-container17 skills in this plugin
/azuresql-db-authConnects an app to the Azure SQL Database container securely, with a least-privilege database user instead of the sa login, the right auth method per environment, and safe handling of the connection secret. Use when a user asks "don't use sa in my app", "create a least-privilege database user", "app login for SQL", "which authentication should my app use", "secure the connection string", "Encrypt / TrustServerCertificate", "store the connection string in Key Vault", "dotnet user-secrets", "managed identity for Azure SQL", or "grant only the roles my app needs". SQL auth locally, Microsoft Entra or managed identity in the cloud, changing only the connection string. Reach for this before wiring an app to connect as sa, or before committing a connection string to source./azuresql-db-ciRuns integration tests against the Azure SQL Database container (Private Preview, local engine) in CI. Use when setting up GitHub Actions, Azure Pipelines, or GitLab CI to test against Azure SQL DB; when adding a database service container to a CI workflow; when tests need a real Azure SQL engine in the pipeline; or when you see "service container", "health-cmd", "ACR_USERNAME/ACR_PASSWORD", "MSSQL_SA_PASSWORD secret", or "integration test database". Also use when a workflow was about to pull the SQL Server image mcr.microsoft.com/mssql/server, in which case stop and use the Azure SQL Database engine image instead. Covers pulling from the private ACR with credentials, the service health check that runs sqlcmd inside the container so the runner needs no client tools, provisioning appdb before tests, and pointing the test connection string at the user database not master.Other plugins' skills for the same job