/microsoft-sql:azuresql-db-connectionsfrom Microsoft SQL
Hardens app data layer connections for Azure SQL Database with connection pooling and retry with backoff for transient faults. Covers the local Azure SQL Database container for local-to-cloud parity.
Ships in Microsoft SQL. 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.
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 (x64 /
linux/amd64, 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). On a non-x64 host add
--platform linux/amd64 (Docker) or platform: linux/amd64 (compose).mcr.microsoft.com/mssql/server (the SQL Server image).ACCEPT_EULA=Y and a complex, caller-supplied MSSQL_SA_PASSWORD. 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.: "${MSSQL_SA_PASSWORD:?Set MSSQL_SA_PASSWORD to a unique local administrator password}"
HOST_PORT=1433; while lsof -nP -iTCP:"$HOST_PORT" -sTCP:LISTEN >/dev/null 2>&1; do HOST_PORT=$((HOST_PORT+1)); done
PLATFORM=(); case "$(docker info -f '{{.Architecture}}' 2>/dev/null)" in x86_64|amd64) ;; *) PLATFORM=(--platform linux/amd64);; esac
docker rm -f sqldb 2>/dev/null
docker run -d --name sqldb "${PLATFORM[@]}" -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD" \
-p "127.0.0.1:$HOST_PORT:1433" sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest
until docker exec sqldb sh -c \
'SQLCMDPASSWORD="$MSSQL_SA_PASSWORD" exec /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -C -b -l 2 -Q "$1"' sh \
"IF DB_ID('appdb') IS NULL CREATE DATABASE appdb;" \
>/dev/null 2>&1; do sleep 2; done
echo "ready on localhost,$HOST_PORT"
Use this non-executable connection-string template with the selected HOST_PORT:
Server=localhost,<HOST_PORT>;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. The local container's sys.messages lists all of these except 10929, a cloud
resource-governance error the container has no reason to raise; keep it in the list for Azure
SQL Database.
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.Use only the tools needed by the selected recipe, at or above these minimum versions:
sqlcmd: go-sqlcmd 1.10.0dotnet: .NET SDK 8.0.421Verify the installed commands before changing resources:
sqlcmd --version
dotnet --version
A missing command, an older version, or a nonzero version check is a prerequisite failure.
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, and do not call a non-x64
host "supported".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
2 plugins in one repository ship this exact skill · first indexed Nov 26, 2026
54 skills in this plugin
/azure-functions-sql-bindingsUse when wiring Azure Functions to Azure SQL Database: a serverless CRUD API with SQL input or output bindings, SqlTrigger on row changes, a SQL trigger that never fires, an output binding that updated instead of inserting./azure-sqlUse when Azure SQL Database comes up without a specific task: what it can do today, GA or preview, which tier, tool or skill fits, current limits and defaults. Routes to the owning skill. Not Managed Instance or SQL Server./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).npx claudepluginhub microsoft/microsoft-sql --plugin microsoft-sqlOther plugins' skills for the same job