/azure-sql-database-container:azuresql-db-importfrom azure-sql-database-container
Imports a .bacpac or .dacpac into a local Azure SQL Database container using SqlPackage. Handles provisioning the target database on master before running the import.
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.
Bring an existing database INTO the local container from a
.bacpac (schema + data) or .dacpac (schema only) using SqlPackage.
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, Msg 40510 for RESTORE, and that
SqlPackage runs on the host because the image does not ship it.
This is the Azure SQL Database engine running locally (Private Preview):
SELECT SERVERPROPERTY('EngineEdition') returns 5 and Edition returns
'SQL Azure'. It is NOT the SQL Server image
mcr.microsoft.com/mssql/server. If you were about to use that SQL Server image, stop
and use this instead.
sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest
(multi-architecture: linux/amd64 and linux/arm64; private preview registry, sign in first). Registry/tag are
provisional during Private Preview.--platform linux/amd64
only to explicitly test x64 emulation.CREATE DATABASE appdb
on a master connection before importing into it.BACKUP and RESTORE are refused in every
session with Msg 40510, exactly as in Azure SQL Database in the cloud, so a
.bak file is not a way in no matter where it is copied. SqlPackage with a
bacpac or dacpac is the import path, which is what the rest of this skill does.USE to switch databases. In a user-database session (the
Azure-faithful context where you develop), USE returns Msg 40508, exactly as
in Azure SQL Database in the cloud. A master connection is a provisioning
session where the Azure statement filter is not enforced, so USE appears to work there, but master is for provisioning
only, not application work. Always select the target database in the connection
string (Database=appdb, or -d appdb for sqlcmd).For full container detail (start recipe, connection model, readiness), see the azuresql-db-container skill. The minimum you need is inlined below.
/Action:Import targeting the provisioned user database.This is the Private Preview supported import path. Always validate the result.
Reuse the canonical start recipe. It picks a free host port, lets the runtime
select the matching architecture, waits for readiness with a retry loop, and provisions the
target database appdb on master in that same loop.
# Pick a free host port (works in bash and zsh).
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"
If the container is already running, just provision the target database on master:
docker exec sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$MSSQL_SA_PASSWORD" -C -b \
-Q "IF DB_ID('appdb') IS NULL CREATE DATABASE appdb;"
The target database MUST exist and be empty before import. SqlPackage imports the user database; it does not create it on the server for you here.
Point /TargetConnectionString at the provisioned database (Database=appdb).
Use the canonical connection string shape: User Id=/Password=/Database=,
TrustServerCertificate=true.
Schema + data (.bacpac):
SqlPackage /Action:Import \
/SourceFile:"./mydatabase.bacpac" \
/TargetConnectionString:"Server=localhost,$HOST_PORT;Database=appdb;User Id=sa;Password=$MSSQL_SA_PASSWORD;TrustServerCertificate=true"
Schema only (.dacpac) uses /Action:Publish, not Import:
SqlPackage /Action:Publish \
/SourceFile:"./myschema.dacpac" \
/TargetConnectionString:"Server=localhost,$HOST_PORT;Database=appdb;User Id=sa;Password=$MSSQL_SA_PASSWORD;TrustServerCertificate=true"
If SqlPackage is not installed locally, see references/sqlpackage-import.md for install options and a container-based fallback.
Confirm the engine identity and spot-check that objects landed:
docker exec sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$MSSQL_SA_PASSWORD" -C -b -d appdb \
-Q "SELECT SERVERPROPERTY('EngineEdition') AS EngineEdition; SELECT COUNT(*) AS Tables FROM sys.tables;"
EngineEdition must be 5. Then verify row counts on a few key tables against
the source.
This engine is Azure SQL Database (Engine Edition 5), so SQL Server features that Azure SQL DB does not support will fail or be skipped on import:
USE <db> in scripts: a user-database session returns Msg 40508. Select the
target database in the connection string (Database=appdb, or -d appdb).DATABASE_DEFAULT collation assumptions and unsupported
compatibility-level features.Read SqlPackage output for skipped/blocking items. See references/sqlpackage-import.md for the common error patterns and fixes.
/TargetConnectionString sets Database=appdb (never the literal master).SERVERPROPERTY('EngineEdition') on the target is 5..bacpac for schema + data via /Action:Import; .dacpac for schema via
/Action:Publish.mcr.microsoft.com/mssql/server SQL Server image.RESTORE DATABASE ... FROM DISK; it is refused with Msg 40510 and copying the .bak into the container does not change that.master; import into the provisioned user database.USE appdb in any pre/post script; select the DB in the connection
string instead./docker-entrypoint-initdb.d/*.sql auto-seeding; it is NOT
honored by this image.docker run as "ready"; provision inside the retry loop.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
Three short reads, in order
17 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./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.npx claudepluginhub microsoft/azure-sql-database-container --plugin azure-sql-database-containerOther plugins' skills for the same job