/microsoft-azuresqldb-container:azuresql-db-functionsfrom Microsoft Azure SQL Database container
Builds serverless CRUD APIs and event-driven handlers on the local Azure SQL Database container using Azure Functions SQL bindings and triggers.
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.
Build HTTP CRUD endpoints and change-driven handlers over the local Azure SQL Database container (Private Preview) using Azure Functions and the first-party Azure SQL bindings. Two capabilities:
Event-driven note: Azure SQL Change Event Streaming (CES) is the cloud path for streaming row changes, and it cannot run against the local container (it is unsupported on the Linux engine and streams only to Azure Event Hubs public endpoints). Locally, use the SQL trigger below. Open references/event-driven.md when you need the reason CES cannot run here, or when a user asks for it by name.
The container supports what the bindings need: Change Tracking on a user database,
compatibility level 130 or higher, and OPENJSON.
mcr.microsoft.com/mssql/server. SERVERPROPERTY('EngineEdition')
returns 5, SERVERPROPERTY('Edition') returns 'SQL Azure'.sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io/azure-sql/db-dev:latest
(x64, linux/amd64). Registry is private: sign in first with
docker login sqldbpreview-dpgaeqhmgphzd4bk.azurecr.io using the shared
pull-only credentials from https://aka.ms/sqldbcontainerpreview-signup (they
may rotate). Registry and tag are provisional during Private Preview.ACCEPT_EULA=Y and a complex MSSQL_SA_PASSWORD (8+ chars,
upper/lower/digit/symbol). Engine listens on 1433.CREATE DATABASE appdb on
a master connection before the function app connects with Database=appdb.
Do not use USE to switch databases; select it in the connection string.--platform linux/amd64.For the full engine model (readiness loop, vectors, troubleshooting) see the
azuresql-db-container skill; to start the container and provision appdb,
use azuresql-db-container or azuresql-db-scaffold.
The bindings read the connection string from an app setting. Use the name
SqlConnectionString (the docs' convention). In local.settings.json:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"SqlConnectionString": "Server=localhost,1433;Database=appdb;User Id=sa;Password=<sa-password>;TrustServerCertificate=true"
}
}
Replace <sa-password> with the container's MSSQL_SA_PASSWORD; local.settings.json stays out of
source control.
TrustServerCertificate=true is required for the container's self-signed cert.
Set FUNCTIONS_WORKER_RUNTIME to your language (dotnet-isolated, node,
python, powershell, java). Bindings reference this setting name via
ConnectionStringSetting (C#/Java), connectionStringSetting (function.json), or
connection_string_setting (Python v2 decorator) - not Connection (that
keyword is for Storage/Event Hubs bindings).
.NET isolated worker: add the NuGet package.
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Sql
JavaScript / TypeScript / Python / PowerShell / Java: use the extension
bundle in host.json (Java also adds the azure-functions-java-library-sql
Maven package):
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.0.0, 5.0.0)"
}
}
Template: choose one supported worker runtime. This example uses dotnet-isolated, but Node.js,
Python, and other runtimes are also available.
func init MyApi --worker-runtime dotnet-isolated
cd MyApi || exit 1
func new --name Books # pick an HTTP trigger template
Then wire the SQL bindings into the function. Per-language snippets (HTTP GET via
input binding, HTTP POST upsert via output binding) are in
references/functions-snippets.md; open it once you know your
language. Open references/functions-bindings-reference.md
when a binding attribute or a function.json field is rejected.
Output-binding requirements: the target table must have a primary key
(the binding upserts via MERGE), and the database compatibility level must
be 130+ (the binding uses OPENJSON). The engine is fully capable; just
ensure the table has a PK.
Run it:
func start # HTTP endpoints on http://localhost:7071/api/<name>
The SQL trigger fires your function when rows change.
There is no SQL trigger template to scaffold from, even though the tooling
lists one. With Azure Functions Core Tools 4.12.0, func templates list advertises a
SQL Trigger entry, but
func new --template SqlTrigger exits non-zero with
Unknown template 'SqlTrigger': the listing and the scaffolder disagree, and no
flag reconciles them. Scaffold an HTTP trigger instead (func new --name ToDoTrigger --template HttpTrigger, which succeeds in the same project) and
write the trigger binding in by hand, as below.
The trigger requires Change
Tracking on the database and table. Enable it once (on appdb, not master):
ALTER DATABASE appdb
SET CHANGE_TRACKING = ON (CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON);
ALTER TABLE dbo.ToDo ENABLE CHANGE_TRACKING;
The function binds to a list of changes, each with an Item and an Operation
(Insert / Update / Delete). C# isolated example:
[Function("ToDoTrigger")]
public static void Run(
[SqlTrigger("[dbo].[ToDo]", "SqlConnectionString")]
IReadOnlyList<SqlChange<ToDoItem>> changes,
FunctionContext context)
{
foreach (var change in changes)
context.GetLogger("ToDoTrigger")
.LogInformation($"{change.Operation}: {change.Item.Id}");
}
The trigger creates an internal az_func schema plus a
Leases_{FunctionId}_{TableId} table (it makes these itself if the principal
can). Behavior, permission grants, and the CES-is-cloud-only detail are in
references/event-driven.md; open it when configuring the trigger or
its least-privilege grants. Since you connect as sa locally, the permission grants are already
satisfied; they matter when you move to least privilege or to the cloud.
mcr.microsoft.com/mssql/server.appdb exists (created on a master connection) before the function app runs;
SqlConnectionString uses Database=appdb and TrustServerCertificate=true.local.settings.json (or app settings), not in
code; bindings reference it via ConnectionStringSetting / connectionStringSetting.mcr.microsoft.com/mssql/server; this is the Azure SQL engine.appdb; provision it on a master connection first.func new --template SqlTrigger; the template is listed but cannot be created. Create an HTTP trigger and add the binding by hand.Connection binding keyword for SQL bindings; it is ConnectionStringSetting / connectionStringSetting.local.settings.json (it holds the connection string / SA password) or drop TrustServerCertificate=true / --platform linux/amd64 on a non-x64 host.SqlConnectionString setting, or host.json trigger tuning.func commands, or a local verification 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
azure-functions, azure-sql, serverless-api, sql-trigger, change-tracking
npx claudepluginhub microsoft/microsoft-sql --plugin microsoft-azuresqldb-container2 plugins in one repository ship this exact skill · first indexed Nov 26, 2026
17 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.Other plugins' skills for the same job