Fix sample issues from review and migrate azlocal to lstk - #105
Merged
Conversation
Addresses review feedback from Andrew Thomas plus a full docs/link audit: - Align function-app-storage-http with .NET 10: allow/default dotnet_version 10.0 in terraform (variables.tf, terraform.tfvars), bump bicep runtimeVersion, refresh stale net9.0 tokens in sample.sln - Bump azurerm provider to =4.81.0 in all 11 samples (dotnet_version "10.0" support landed in 4.54.0); terraform validate passes for all samples - Replace the deprecated azlocal CLI with lstk everywhere: READMEs (prerequisites, install blocks, interception commands, references), run-samples.sh (lstk az login/account/group/interception), CI install step (npm install -g @localstack/lstk), drop azlocal/terraform-local from requirements-runtime.txt and pyproject.toml - Remove fictional documentation: tflocal/azlocal auto-detection claims, funclocal prerequisites and steps, fake AZ= dispatch snippets, fabricated script output - Convert function-app-storage-http scripts/deploy.sh from `func azure functionapp publish` (with NuGet proxy workaround) to dotnet publish + zip + `az functionapp deploy`, matching the sample's terraform/bicep paths; drop the now-unused Azure Functions Core Tools requirement from run-samples.sh and CI - Guard `dotnet publish` failures and recreate the deployment zip in the function-app-storage-http deploy scripts (avoids deploying stale builds) - Add `--max-time 10` to all 44 curl calls in call/test scripts (fixes long stalls when the container IP is unreachable, e.g. on macOS) - Fix wrong cd paths (copy-pasted sample dir, pre-rename folder names, stale `cd python`), 17 broken relative links, 5 dead external links, HubSpot tracking params in 31 files, and assorted typos/duplicate headings Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Andrew Thomas's review of the samples surfaced several issues:
function-app-storage-http/dotnetbuilds anet10.0app, but its Terraform config provisioned a .NET 9 host (dotnet_versiondefault9.0, allowlist6.0/8.0/9.0) — the worker crashes with an opaquedotnet exited with code 150 / app-launch-failed.terraform/README.mdclaimeddeploy.shauto-detects LocalStack and switches totflocal/azlocal— the script has no such logic.scripts/README.mdlisted afunclocalprerequisite (archived tool) that no script uses.cdpointing at a different sample's directory.call-web-app.shcurls the container's internal Docker IP with no timeout, stalling for minutes on macOS.As agreed, we move forward to .NET 10 (not back to 9) by bumping the azurerm provider, and we take the opportunity to complete the planned migration from the deprecated
azlocalCLI to the newlstkCLI plus a full broken-link audit of every README. The emulator already supports .NET 10 (10.0.2insupported_platforms.jsonsince #6191).The first CI round then surfaced two emulator gaps with azurerm 4.81 and two unrelated breakages, all fixed in the second commit (see "azurerm 4.81 CI fallout" below).
Fixes SMF-826
Changes
.NET 10 / azurerm alignment
function-app-storage-http/dotnet:dotnet_versiondefault + allowlist now include10.0(variables.tf),terraform.tfvarsbumped to10.0(it overrode the default), bicepruntimeVersion'9.0'→'10.0', stalenet9.0tokens insample.slnrefreshed, staleRUNTIME_VERSION="9"snippet in the scripts README corrected.=4.81.0in 9 of 11 samples (was a mix of 4.14/4.25/4.60;dotnet_version = "10.0"requires ≥ 4.54.0). Two samples stay on=4.60.0with bump-back comments because the current emulator cannot serve them on 4.81 (see below).azurerm 4.81 CI fallout (second commit)
aci-blob-storage/terraform:deploy.shpre-creates the RG and imports it, so the config tags forced an in-place RG update that azurerm 4.81 issues as PATCH — not implemented by the emulator (501). Fixed withlifecycle { ignore_changes = [tags] }on the imported RG.web-app-sql-database/terraform: azurerm > 4.60 strictly parses thesidreturned for Key Vault certificates; the emulator returns the certificate id there (expected NestedItemType to be secrets, got certificates). Pinned to=4.60.0(bisected live: 4.60 passes, 4.80 fails); emulator parity fix prepared separately.web-app-cosmosdb-mongodb-api/terraform: with 4.81 the Cosmos Mongo collection create/get requests hang in the emulator (never complete; 30-minute create timeout kills the job). Pinned to=4.60.0; emulator fix tracked separately.function-app-front-door/scripts(unrelated to azurerm):az afdmoved from azure-cli core into thecdnextension, which removed the flattened--match-variable/--action-name/--rule-setsarguments. Rewrote the threeaz afd rule createcalls to structured--conditions/--actionsshorthand and the route attachment to--formatted-rule-sets(each verified against the emulator).run-samples.sh:lstk az <cmd>proxy calls fail on CI runners with "Azure CLI integration is not set up".lstk az start-interceptionworks, so login/account/cleanup commands now use the plainazCLI once interception is active.enable_rbac_authorization→rbac_authorization_enabledwhere the pinned provider supports it.azlocal → lstk migration (205 references, 52 files)
azlocal start-interception/stop-interception→lstk az start-interception/stop-interception.pip install azlocal→ brew/npm), and prose rewritten for lstk;lstk CLIdocs + GitHub repo links added to every sample's References/Related Documentation section (created where missing).npm install -g @localstack/lstk);azlocaldropped fromrequirements-runtime.txt,azlocal/terraform-localdropped frompyproject.toml.Documentation now matches reality
tflocal/azlocalauto-detection claims,funclocalprerequisites/steps, fakeAZ="azlocal"dispatch snippets (servicebus), and fabricated script output.function-app-storage-http/dotnet/scripts/deploy.shfromfunc azure functionapp publish(with NuGet proxy workaround) todotnet publish+ zip +az functionapp deploy, matching the sample's terraform/bicep paths; the now-unused Azure Functions Core Tools requirement is dropped fromrun-samples.shand CI. All three deploy scripts of the sample now guarddotnet publishfailures and recreate the zip (no stale-build deploys).Robustness & link audit
--max-time 10added to all 44 curls in call/test scripts (the repo's existing timeout pattern) — fixes the macOS stall on unreachable container IPs.cd(terraform README pointed atfunction-app-managed-identity), two pre-renamefunction-app-and-storagepaths, three stalecd pythonlines, 17 broken relative links, 5 dead external links (moved Microsoft Learn pages, old LocalStack auth-token URL), HubSpot tracking params in 31 files, and assorted typos/duplicate headings.Tests
localstack/localstack-azure:latestbefore fixing (RG PATCH 501, KV certsidparse, Cosmos Mongo hang,az afdargument errors); the azurerm cutoff for the KV cert issue was bisected live (4.60 PASS / 4.80 FAIL).terraform init && terraform validatepasses for all samples on their pinned providers;bash -npasses for every modified script;dotnet build -c Releaseof the .NET 10 sample succeeds locally (SDK 10.0.103).azlocal/tflocal/funclocalreferences remain (one intentional explanatory CI comment).az afdcommands and the newlstkflow were exercised locally against the emulator; pre-commit (zizmor, gitleaks) passes.Related
=4.60.0pins: Key Vault certificatekid/sidparity (fix branchfix/keyvault-certificate-sid-kid-parity) and the Cosmos Mongo collection create/get hang — Linear issues to be filed.🤖 Generated with Claude Code