Add an end-to-end Azure Functions SQL trigger test #2

Merged
hannah-vernon merged 1 commit from feature/functions-trigger-test into dev 2026-11-19 17:05:24 -05:00
Owner

What does this PR do?

Adds tests/functions-trigger/, an end-to-end test of the Azure Functions SQL trigger against the lab container, and records the result in the README.

Microsoft's container FAQ lists Change Tracking as not included, while the Functions SQL trigger, which depends on it, is documented as the local event-driven option. This test shows what happens with a real function: a .NET 8 isolated worker (packages pinned, NuGetAudit failing the build on any known vulnerability), Azure Functions Core Tools 4.16.0, and Azurite pinned by digest. The script creates a scratch database and a throwaway login with a random password, writes the only copy of that password to local.settings.json in a temporary folder (the Functions host reads connection settings from there or from environment variables), runs inserts, updates and deletes, checks what the function received, and always cleans up: host, Azurite, login, database and folder.

Also adds bin/, obj/ and local.settings.json to .gitignore, and lists the test-time tools in THIRD-PARTY-NOTICES.md.

Fixes #

How was this tested?

  • PowerShell files parse in Windows PowerShell 5.1 and PowerShell 7
  • shellcheck scripts/*.sh compose/*.sh is clean (no shell changes)
  • Ran tests/functions-trigger/Test-FunctionsTrigger.ps1 in PowerShell 7 and in Windows PowerShell 5.1: both PASS, with Insert Id=2 Title=second, updated and Delete Id=1 Title= (Change Tracking net changes). Afterwards: no temporary folder, no Azurite container, no func process, and no ct_func_scratch database or ct_func_test login.
  • dotnet list package --vulnerable --include-transitive: no vulnerable packages (52 including transitive)
  • Runtime and platform: Windows 11, WSL 2 Debian 13, Docker 29.8.2, Compose 5.6.0, .NET SDK 8.0, Core Tools 4.16.0
  • Image digest: sha256:8323f47dad34124f391413c3c3182ca89da5632888df6cfb5326574026599c57

Checklist

  • I have read the Contributing Guide
  • Changes are focused - one logical change per PR
  • Documentation updated (if user-visible behaviour changed)
  • The password never reaches a command line, an environment variable of a host process, a log, docker inspect or the console. The sa password is not used at all; the throwaway login's password exists only in the temporary local.settings.json and the dropped login.
  • No real host names, databases, passwords or customer data
  • No commented-out code or debug leftovers
## What does this PR do? Adds `tests/functions-trigger/`, an end-to-end test of the Azure Functions SQL trigger against the lab container, and records the result in the README. Microsoft's container FAQ lists Change Tracking as not included, while the Functions SQL trigger, which depends on it, is documented as the local event-driven option. This test shows what happens with a real function: a .NET 8 isolated worker (packages pinned, NuGetAudit failing the build on any known vulnerability), Azure Functions Core Tools 4.16.0, and Azurite pinned by digest. The script creates a scratch database and a throwaway login with a random password, writes the only copy of that password to `local.settings.json` in a temporary folder (the Functions host reads connection settings from there or from environment variables), runs inserts, updates and deletes, checks what the function received, and always cleans up: host, Azurite, login, database and folder. Also adds `bin/`, `obj/` and `local.settings.json` to `.gitignore`, and lists the test-time tools in `THIRD-PARTY-NOTICES.md`. Fixes # ## How was this tested? - [x] PowerShell files parse in Windows PowerShell 5.1 and PowerShell 7 - [ ] `shellcheck scripts/*.sh compose/*.sh` is clean (no shell changes) - [x] Ran `tests/functions-trigger/Test-FunctionsTrigger.ps1` in PowerShell 7 and in Windows PowerShell 5.1: both PASS, with `Insert Id=2 Title=second, updated` and `Delete Id=1 Title=` (Change Tracking net changes). Afterwards: no temporary folder, no Azurite container, no `func` process, and no `ct_func_scratch` database or `ct_func_test` login. - [x] `dotnet list package --vulnerable --include-transitive`: no vulnerable packages (52 including transitive) - [x] Runtime and platform: Windows 11, WSL 2 Debian 13, Docker 29.8.2, Compose 5.6.0, .NET SDK 8.0, Core Tools 4.16.0 - [x] Image digest: sha256:8323f47dad34124f391413c3c3182ca89da5632888df6cfb5326574026599c57 ## Checklist - [x] I have read the [Contributing Guide](../CONTRIBUTING.md) - [x] Changes are focused - one logical change per PR - [x] Documentation updated (if user-visible behaviour changed) - [x] The password never reaches a command line, an environment variable of a host process, a log, `docker inspect` or the console. The sa password is not used at all; the throwaway login's password exists only in the temporary `local.settings.json` and the dropped login. - [x] No real host names, databases, passwords or customer data - [x] No commented-out code or debug leftovers
tests/functions-trigger runs a .NET 8 isolated function with the SQL trigger against the lab, using a throwaway login and Azurite, and cleans up afterwards.  It passes on build 12.0.2000.8 (Nov 17 2026) although the FAQ lists Change Tracking as not included.  README finding, .gitignore and third-party notices updated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hannah-vernon/azure-sql-db-container-lab!2
No description provided.