/microsoft-sql:azuresql-db-testingfrom Microsoft SQL
Writes integration tests that start a real Azure SQL Database container via Testcontainers (xUnit, Jest, pytest) with per-test fixtures. Use when tests manage their own engine lifecycle in-process.
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.
Write integration tests that start a real Azure SQL Database container (Private Preview)
from code, provision appdb, run the test against it, and tear the container
down. This is the Azure SQL engine, not the SQL Server image.
This skill is about tests that manage their own engine lifecycle in-process (Testcontainers). It is DISTINCT from azuresql-db-ci, which wires the same engine into a CI pipeline as a service container via workflow YAML. If the goal is a CI job rather than in-code test setup, use azuresql-db-ci instead.
The image ships the /opt/mssql-tools18/bin tools, so a wait strategy can run sqlcmd inside
the container.
sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latestMsSql preset / MsSqlContainer module, which
pulls mcr.microsoft.com/mssql/server (the SQL Server image). Start the engine image
above from a generic container instead.SELECT SERVERPROPERTY('EngineEdition') returns 5,
SERVERPROPERTY('Edition') returns 'SQL Azure'.linux/amd64
(each language exposes this differently; see the snippets).For full engine detail (readiness, vectors, troubleshooting) see the azuresql-db-container skill.
The registry is private during Private Preview, so Testcontainers cannot pull the image until Docker is authenticated. Sign in once (or pre-pull) on the machine that runs the tests, before the test host tries to start the container:
docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io # shared pull-only Private Preview creds
docker pull sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest # optional warm pull
Get the pull credentials by signing up at https://aka.ms/sqldbcontainerpreview-signup;
they may rotate, and the registry and tag are provisional during Private Preview. In CI,
run docker login as a step before the tests (see azuresql-db-ci).
SELECT 1 command wait) so
the test does not connect before the engine answers. Do not sleep a fixed amount.CREATE DATABASE appdb on a master connection before any test connects with
Database=appdb. Testcontainers gives you a container, not a database.USE to switch databases. In a user-database session USE returns
Msg 40508, exactly as in Azure SQL in the cloud. Select the database in the
connection string (Database=appdb). A master connection is for provisioning only.ACCEPT_EULA=Y and a complex
MSSQL_SA_PASSWORD (read from the environment, never a literal in test code; at least 8 characters using
at least three of upper case, lower case, digits, and symbols). Expose container port
1433. On a non-x64 host, set the image platform to linux/amd64.Start returns only once the engine answers.appdb on a master connection (a SELECT 1 plus
IF DB_ID('appdb') IS NULL CREATE DATABASE appdb;).Server=localhost,<mappedPort>;Database=appdb;User Id=sa;Password=<sa-password>;TrustServerCertificate=true.
House style spells the keywords User Id= / Password= / Database=; Uid= / Pwd= are
documented SqlClient synonyms and work too. The command-line equivalent of
TrustServerCertificate=true is -C, as on the command line the
azuresql-db-container skill carries.Scope the container to the level you need: one per test suite/class for speed, or one per test for full isolation. Per-language recipes (wait strategy, appdb provisioning, connection string, dispose) live in references/testcontainers-snippets.md; open it once you know which language the tests are in:
IAsyncLifetime fixture.testcontainers + a Jest globalSetup / globalTeardown.testcontainers + a pytest fixture.@Container.Native VECTOR(n) column type and VECTOR_DISTANCE('cosine', a, b). Insert with
CAST(CAST(? AS NVARCHAR(MAX)) AS VECTOR(n)) where n is a LITERAL, never a bind
parameter (a parameter dimension fails with "Incorrect syntax near '@P3'").
MsSql preset
or mcr.microsoft.com/mssql/server.sleep.appdb is created on a master connection BEFORE any test connects with Database=appdb.User Id=/Password=/Database= and TrustServerCertificate=true.EngineEdition is 5 against the running container.Use only the tools needed by the selected recipe, at or above these minimum versions:
dotnet: .NET SDK 8.0.421Verify the installed commands before changing resources:
dotnet --version
A missing command, an older version, or a nonzero version check is a prerequisite failure.
MsSql preset image mcr.microsoft.com/mssql/server; start
the Azure SQL engine image via a generic container.appdb exists; provision it on a master connection first.USE appdb to switch databases; put it in the connection string.appdb provisioning, mapped-port connection string, and disposal.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
npx claudepluginhub microsoft/microsoft-sql --plugin microsoft-sql54 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).2 plugins in one repository ship this exact skill · first indexed Nov 26, 2026
Other plugins' skills for the same job