/microsoft-azuresqldb-container:azuresql-db-importfrom Microsoft Azure SQL Database container
Imports a .bacpac or .dacpac into a local Azure SQL Database container using SqlPackage. Use when loading production schema and data into a local PaaS-faithful environment.
Ships in Microsoft 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. The image does not ship
SqlPackage, so it runs on the host.
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
(x64, linux/amd64; private preview registry, sign in first). Registry/tag are
provisional during Private Preview.--platform linux/amd64./Action:Import can create a missing target database when the
authenticated user has create-database permissions. Pre-creation is optional.
If the target already exists, it must contain no user-defined schema objects./p:DatabaseEdition and /p:DatabaseServiceObjective unset for the
container. These select Azure service tiers, not whether Import creates the
database. Use the container's defaults instead.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 new or empty 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, adds --platform
only on a non-x64 host, and waits for readiness on master with a retry loop.
It does not need to create the target database before import.
# Pick a free host port and add the platform flag only on a non-x64 host (works in bash and zsh).
: "${MSSQL_SA_PASSWORD:?Set MSSQL_SA_PASSWORD to a unique password}"
export MSSQL_SA_PASSWORD SQLCMDPASSWORD="$MSSQL_SA_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 -e SQLCMDPASSWORD sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -C -b -l 2 -d master \
-Q "SELECT 1;" >/dev/null 2>&1; do sleep 2; done
echo "ready on localhost,$HOST_PORT"
If the container is already running, reuse it and check readiness on master. To pre-create the target explicitly, optionally run:
: "${MSSQL_SA_PASSWORD:?Set MSSQL_SA_PASSWORD to the password used by the running container}"
export SQLCMDPASSWORD="$MSSQL_SA_PASSWORD"
docker exec -e SQLCMDPASSWORD sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -C -b -d master \
-Q "IF NOT EXISTS (SELECT 1 FROM sys.databases WHERE name = N'appdb') CREATE DATABASE appdb;"
Pre-creation is not required: SqlPackage can create
appdbduring import. Ifappdbalready exists, it must contain no user-defined schema objects. Check existence throughsys.databaseson master;DB_ID('appdb')can return NULL for a different database on Azure SQL Database.
Point /TargetConnectionString at the intended database (Database=appdb),
even when it does not exist yet.
Use the canonical connection string shape: User Id=/Password=/Database=,
TrustServerCertificate=true.
Schema + data (.bacpac):
SqlPackage @<(printf '%s\n' \
'/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 @<(printf '%s\n' \
'/Action:Publish' \
'/SourceFile:"./myschema.dacpac"' \
"/TargetConnectionString:\"Server=localhost,$HOST_PORT;Database=appdb;User Id=sa;Password=$MSSQL_SA_PASSWORD;TrustServerCertificate=true\"")
These commands use SqlPackage's response-file support through shell process substitution, so the password is not placed in the SqlPackage process arguments or written to a persistent file.
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 -e SQLCMDPASSWORD sqldb /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -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.Use only the tools needed by the selected recipe, at or above these minimum versions:
sqlpackage: SqlPackage 170.4.83.3sqlcmd: go-sqlcmd 1.10.0Verify the installed commands before changing resources:
sqlpackage /Version
sqlcmd --version
A missing command, an older version, or a nonzero version check is a prerequisite failure.
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; name the intended user database as the target.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.--platform linux/amd64
on a non-x64 host.docker run as "ready"; check master 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
npx claudepluginhub microsoft/microsoft-sql --plugin microsoft-azuresqldb-container17 skills in this plugin
/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)./azuresql-db-ciUse when CI (GitHub Actions, Azure Pipelines, GitLab) runs integration tests against the Azure SQL Database container as a service: health check, registry secrets. For Testcontainers, use `azuresql-db-testing`./azuresql-db-connectionsUse when hardening an app's data layer: connections drop or time out under load, add pooling and retry with backoff for transient faults, Max Pool Size. Also covers the local Azure SQL Database container./azuresql-db-containerUse when running Azure SQL Database or any SQL/mssql container locally for dev or CI: start it, connect with sqlcmd, Podman, won't start, Entra setup. Use instead of mcr.microsoft.com/mssql/server./azuresql-db-dabUse when asked for an API over existing tables ('give me an API for this database', REST and GraphQL without code), or to run a local Data API builder endpoint on the Azure SQL Database container./azuresql-db-faqUse when asking what the local Azure SQL Database container (Private Preview) supports or why it differs from the cloud: can I back up, why USE fails, can't create a vector index, SSMS errors.2 plugins in one repository ship this exact skill · first indexed Nov 26, 2026
Other plugins' skills for the same job