/azure-sql-database-container:azuresql-db-authfrom azure-sql-database-container
Wires an app to Azure SQL Database with a least-privilege user, environment-appropriate auth (SQL locally, Entra/managed identity in cloud), and secure connection secret handling. Use before connecting as sa or committing connection strings to source.
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.
sa is a bootstrap/admin login for provisioning, not what your application should
connect as. This skill wires the app to a least-privilege user, picks the
auth method per environment (SQL locally, Microsoft Entra or managed identity
in the cloud, changing only the connection string), secures the connection, and
keeps the secret out of source control.
Re-measured on 2026-09-19 against the container image tag 18.0.226_4_147, reporting
EngineEdition 5, Edition SQL Azure, build 12.0.2000.8. All seven executable checks
behind this skill pass, and three of the numbers this skill used to print were wrong:
a contained user is refused with Msg 33233 and not Msg 15007, SET CONTAINMENT = PARTIAL is refused with Msg 12824 and not Msg 12844, and
CREATE USER ... FROM EXTERNAL PROVIDER on a container started without Entra
configuration is refused with Msg 33134 and not Msg 37525. Each statement is still
refused, so every instruction here is unchanged; only the numbers to expect are. The fixed
database roles this skill grants were confirmed on the same run. The cloud side of this
guidance, Azure Key Vault and managed identity, was not measured and comes from Microsoft
Learn.
mcr.microsoft.com/mssql/server. SERVERPROPERTY('EngineEdition')
returns 5, Edition returns 'SQL Azure'.sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest
(multi-architecture: linux/amd64 and linux/arm64; the runtime selects
the matching image). Required env
ACCEPT_EULA=Y + a complex MSSQL_SA_PASSWORD. 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.SQL_CONNECTION_STRING env var; strings use User Id= /
Password= / Database= and TrustServerCertificate=true for the local
self-signed cert.CREATE USER ... WITH PASSWORD) does not work on the container today, and
you cannot turn it on. CREATE USER ... WITH PASSWORD fails with Msg 33233
("You can only create a user with a password in a contained database").
ALTER DATABASE ... SET CONTAINMENT = PARTIAL fails with Msg 12824, which asks
for the contained database authentication setting to be 1, and sp_configure
does not exist on this engine (Msg 2812), so there is nothing to set. Create a SQL
app identity as a server login mapped to a database user instead. This is the
inverse of Azure SQL Database in the cloud, where the contained user is the norm.
Measured 2026-09-19 on image tag 18.0.226_4_147.CREATE USER [name] FROM EXTERNAL PROVIDER is refused with Msg 33134,
"Principal '...' could not be resolved. Error message: 'Unable to query Azure AD
certificate from local cert store.'" That is a missing engine configuration, not a
broken statement: enable Entra first (see references/entra-auth.md in the
azuresql-db-container skill) and the same statement then works. Measured
2026-09-19 on image tag 18.0.226_4_147.sa)Do provisioning as sa, then give the app its own identity with only the roles
it needs. The working recipe differs by environment, but the app code does not
(the app just connects with a username and password, or an Entra token).
Local container (SQL auth): create a server login on master, map a
database user to it in appdb, and grant only the roles the app needs.
-- On a master connection:
CREATE LOGIN applogin WITH PASSWORD = 'An0ther_Str0ng_Passw0rd';
-- On an appdb connection (Database=appdb):
CREATE USER appuser FOR LOGIN applogin;
ALTER ROLE db_datareader ADD MEMBER appuser; -- read
ALTER ROLE db_datawriter ADD MEMBER appuser; -- write
-- Grant EXECUTE only if the app calls procedures; do NOT add db_owner.
The app then connects as applogin, never sa.
Cloud (Azure SQL Database) or Entra anywhere: prefer a contained user.
For Entra (which works on the container too, once enabled), use
CREATE USER [name] FROM EXTERNAL PROVIDER in appdb. Enable Entra on the engine
first via the azuresql-db-container skill, references/entra-auth.md; without
that configuration the statement is refused with Msg 33134. In the
cloud with SQL auth, CREATE USER ... WITH PASSWORD is the norm there. Full
recipes for every path are in
references/auth-and-secrets.md.
sa bootstraps; the app connects as the least-privilege
applogin. Server=localhost,1433;Database=appdb;User Id=applogin;Password=...;Encrypt=true;TrustServerCertificate=true.Authentication=Active Directory Managed Identity rather
than Active Directory Default: Default walks a credential chain
(DefaultAzureCredential) that is slower and ambiguous under load, while a
specific method skips the chain. Microsoft.Data.SqlClient caches the token, so
refresh is occasional, not per-connection. This is still a connection-string-only
change, so the app code does not change (see the azuresql-db-local-to-cloud skill).Encrypt=true everywhere (the default in modern drivers). Encrypt the TLS
channel in both local and cloud.TrustServerCertificate=true only locally, to accept the container's
self-signed cert. Never set it against Azure SQL Database in the cloud, where
the certificate is real and validating it is the point.The connection string carries a credential. Never commit it or the SA password.
SQL_CONNECTION_STRING; put local values in a
.env that is git-ignored (or dotnet user-secrets for .NET).For a .NET project the local value goes in the secret store rather than in a file that can be committed:
dotnet user-secrets init
dotnet user-secrets set "SQL_CONNECTION_STRING" "Server=localhost,1433;Database=appdb;User Id=appuser;Password=$MSSQL_SA_PASSWORD;TrustServerCertificate=true"
Open references/auth-and-secrets.md when you need the
per-stack handling for Key Vault, user-secrets or .env.
sa; it has only the
roles it needs (no db_owner/admin).CREATE LOGIN on master, then CREATE USER ... FOR LOGIN in appdb),
not a contained CREATE USER ... WITH PASSWORD (which fails on the container).
The database user and its role grants are created on the appdb connection, not
via USE.Encrypt=true; TrustServerCertificate=true
appears only for the local container, never for the cloud.Active Directory Default in production; only the connection string changes.sa; sa is for provisioning only.CREATE USER ... WITH PASSWORD on the container; it fails with Msg 33233. Do not try to turn partial containment on either: ALTER DATABASE ... SET CONTAINMENT = PARTIAL fails with Msg 12824, and the sp_configure setting it asks for does not exist on this engine. Use a server login plus a mapped database user locally.CREATE USER ... FROM EXTERNAL PROVIDER against a container with no Entra configuration; it is refused with Msg 33134. Configure Entra on the engine first.db_owner or server admin when read/write roles suffice.TrustServerCertificate=true against Azure SQL Database in the cloud; that disables cert validation on a real certificate.DefaultAzureCredential's full chain in a hot production path; pick a specific auth method (managed identity) so token acquisition is fast and predictable.mcr.microsoft.com/mssql/server; this is the Azure SQL engine.CREATE USER FROM EXTERNAL PROVIDER), the connection strings per environment (SQL, Entra, managed identity), and per-stack secret handling (Azure Key Vault, dotnet user-secrets, .env).Authoritative, version-pinned references for the tools this skill uses (read the one you need):
Authentication, Encrypt, User Id/Password, pooling, and the rest.WITH PASSWORD, and FROM EXTERNAL PROVIDER for Entra.db_datareader, db_datawriter, and more) for least-privilege grants.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
17 skills in this plugin
/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./azuresql-db-connectionsMakes an app's database connections reliable against the local Azure SQL Database container (Private Preview) and, unchanged, against Azure SQL Database in the cloud: connection pooling plus retry/transient-fault handling. Use when the user mentions "connection pooling", "retry logic", "transient fault", "retry on transient error", "EnableRetryOnFailure", "connection resiliency", "reliable connections", "pool size", "Max Pool Size", or says "the connection keeps dropping", "connections time out under load", "add backoff", or "make the DB layer resilient". This is the Azure SQL engine (EngineEdition 5), not the mssql/server SQL Server image. Reach for this whenever hardening a data-access layer that talks to SQL Server or Azure SQL./azuresql-db-containerRuns 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", "MSSQL_AAD_CLIENT_ID", 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-dabStands up an instant no-code REST + GraphQL API over the local Azure SQL Database container using Microsoft Data API Builder (DAB). Use when a user wants to "expose my table as an API", "add a REST API over the database", "generate a GraphQL API", "put an API in front of SQL", "CRUD API without writing code", or "dab init / dab-config.json". Also the way to serve a built-in MCP endpoint FROM the database via DAB (an API surface DAB provides, not a separate SQL MCP server). Prefer this over hand-writing a controller/ORM API when the user just needs REST or GraphQL over existing tables. Triggers include "Data API Builder", "dab start", "instant API over Azure SQL", "expose entities as REST/GraphQL". Reach for this even when the user only says "give me an API for this database"./azuresql-db-faqAnswers 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./azuresql-db-feedbackReports a bug or files feedback about the azuresql-db-* agent skills themselves, or about the Azure SQL Database container (Private Preview). Use when the user says a skill or the container "did not work", hit an error, behaved unexpectedly, or is missing something; and when they say "report a bug", "file an issue", "open a GitHub issue", "request a feature", "give feedback", or "tell the team". Also use when you, the agent, had to deviate from an azuresql-db-* skill or work around a defect in one to finish a task: that is a bug worth reporting even if the task succeeded. Decides whether the problem belongs to the SKILL or to the CONTAINER, since they use different issue templates, then builds a complete prefilled GitHub issue from context you already have. Never submits anything without explicit confirmation from the user.npx claudepluginhub microsoft/azure-sql-database-container --plugin azure-sql-database-containerOther plugins' skills for the same job