Skip to content

Monitor every web and function app sample with Application Insights - #154

Merged
paolosalvatori merged 70 commits into
mainfrom
samples-application-insights
Nov 20, 2026
Merged

paolosalvatori merged 70 commits into
mainfrom
samples-application-insights

Conversation

@paolosalvatori

@paolosalvatori paolosalvatori commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The web app and function app samples deployed their apps and data services, but nothing showed how to monitor them: most had no Application Insights resource, no Log Analytics workspace and no diagnostic settings, and their code sent no telemetry. Customers who build on these samples need the monitoring that a production deployment has, and they need it to work the same way on LocalStack for Azure and on Azure.

Every web app and function app sample, in Python and .NET and with all three deployment methods (Azure CLI scripts, Bicep and Terraform), now gets a workspace-based Application Insights resource, a Log Analytics workspace, diagnostic settings on every resource that offers them, and app code that sends requests, traces, exceptions, custom events and a custom metric. Each sample also gets scripts that read that telemetry, logs and metrics back. Two new samples complete the language matrix.

Fixes SMF-1152 and SMF-1158

Changes

  • Every resource from a module. Bicep and Terraform create every resource through a module, as web-app-app-configuration/dotnet already did. Only the Terraform resource group stays in main.tf.
  • Monitoring resources. Each sample creates a Log Analytics workspace and a workspace-based Application Insights resource, and sets the apps' APPLICATIONINSIGHTS_CONNECTION_STRING app setting to its connection string.
  • Diagnostic settings on every resource that offers them, sent to the workspace: web apps, function apps, App Service plans, key vaults, storage accounts and their blob, queue, table and file services, databases and servers, Service Bus and Event Hubs namespaces, Event Grid, API Management, Front Door, container registries, App Configuration stores, NAT gateways and the workspace itself. The Application Insights resource gets none: Learn says it can't send to the workspace it's based on.
  • Telemetry in the code:
    • The web apps use the Azure Monitor OpenTelemetry Distro.
    • The function apps use OpenTelemetry with Azure Functions ("telemetryMode": "OpenTelemetry" in host.json). The two Linux Consumption function apps (eventhubs, eventhubs-eventgrid) call configure_azure_monitor(logger_name="function_app") in function_app.py, since their Python worker sent none of the app's telemetry when the PYTHON_APPLICATIONINSIGHTS_ENABLE_TELEMETRY app setting asked it to.
    • Each app logs through its own logger, logs its exceptions, and sends a custom event and a custom metric that mean something in the sample's scenario.
  • Query scripts. Each sample has query-telemetry.sh, which calls the app and reads its requests, traces, exceptions, custom events and custom metric back from Application Insights, and query-logs-and-metrics.sh, which reads every resource's logs and metrics from the workspace. run-samples.sh runs both in CI.
  • New samples: function-app-managed-identity/dotnet (a .NET version of the text processor) and function-app-storage-http/python (a Python version of the gaming scoreboard).
  • CI: the temporary Azurite 3.37.0 pin is gone. Keep DNS enabled and fix Azure sample deployment compatibility #153 pinned Azurite 3.37.0, because the released emulator signed Blob and Queue requests in a way Azurite 3.38 rejects. The emulator image now carries the signing fix (SMF-1176), so this PR removes .github/scripts/prepare-azurite.sh, its calls before the Linux and the Windows emulator start in run-samples.yml, its INFRA_FILES entry in build-matrix.sh, and the test that ran every sample when it changed (tests/test_ci_dependencies.py, whose five Microsoft-download cases stay). CI runs the Azurite release the emulator pulls.
  • function-app-service-bus/dotnet on Flex Consumption. Its Bicep template and Terraform configuration offered the FlexConsumption tier and the FC1 SKU, but neither could create a function app on that plan. With skuTier = 'FlexConsumption' and skuName = 'FC1' (Bicep) or sku_name = "FC1" (Terraform), the app now gets a functionAppConfig (Terraform: azurerm_function_app_flex_consumption) with its runtime, its scale settings and a deployment container of its storage account, and leaves out the settings the plan replaced. With the user-assigned identity it also gets SERVICE_BUS_CONNECTION_STRING__credential and __clientId: without them its Service Bus trigger uses the system-assigned identity, and on Azure the input queue was never drained. The deploy scripts keep using config-zip, since Azure answers az functionapp deploy with 415 on that plan; on the emulator, config-zip's closing health check refuses the app's host name, which carries a port, so the scripts then read the status of the deployment itself. A moved block keeps the function app of an existing Terraform state. The default stays a Standard S1 plan.
  • Upgrading a Terraform deployment of the earlier version. Each of the ten Terraform configurations that moved resources into modules has a moved.tf, so terraform apply over a deployment made with the version on main moves each resource into its module instead of destroying and recreating it, and each outputs.tf reads its values from the modules, with the names and values the earlier version had. url-shortener keeps the storage account name it had, and its deploy.sh imports into the state the storage account's default diagnostic setting, which the earlier version's deploy.sh created with the Azure CLI, so the plan updates it instead of failing on a setting that already exists.
  • Architecture diagrams show the workspace and the Application Insights resource, and every README describes the monitoring and how to query it.
  • Fixes found by running the samples on Azure, each now proven on both targets:
    • Function code deployments retry a 504 from the deployment endpoint, and the Linux Consumption function apps deploy with az functionapp deployment source config-zip --build-remote true, retried for ten minutes, since their deployment endpoint can answer 503 for several minutes after the app is written.
    • The .NET function samples deploy the published package with config-zip, so Kudu doesn't run an Oryx build of it.
    • url-shortener scripts give the deploying principal Key Vault Secrets Officer on its RBAC vault before writing secrets.
    • api-management-function-app's validate.sh waits for the gateway's first answer: on Azure, right after an upgrade of a deployment, the first call got no answer within ten seconds.
    • url-shortener's query-logs-and-metrics.sh shortens a link of its own before it reads the worker's invocation records (FunctionAppLogs): on Azure the records of a new diagnostic setting's first minutes can be lost, and the invocations the earlier scripts caused were among them.
    • web-app-sql-database Bicep lets its deployer create the web app's certificate.
    • web-app-cosmosdb-nosql-api builds its source package on deployment.
    • The Event Hubs samples set the content share after the template, create every event hub with its cleanup policy, create the dashboard's plan after the Linux Consumption plan, and start the dashboard with App Service's default command.
    • function-app-front-door waits for each function app to list its functions after its deployment, and restarts the app once if it doesn't: on Azure the second app finished its deployment without loading the package, and answered 404 on every route until a restart, in two runs on 2026-11-18.
    • function-app-front-door's validate.sh retries the URL rewrite check while the rule set rolls out, and gives a re-enabled endpoint the twenty minutes a new one gets: on Azure, /shop/2 answered 404 right after the endpoint served the catalog and was rewritten later, and a re-enabled endpoint served again about eleven minutes after it was enabled.
    • The Event Hubs pipeline restarts its function app with az functionapp restart, which the emulator implements now, instead of redeploying the package, which Azure refuses on the Linux Consumption plan, and it first gives the function a minute to export its metrics, since a restart can drop what the distro aggregated since its last export. Both pipelines run on Azure as well as on the emulator.
    • PostgreSQL and MySQL Terraform create the private endpoint after the server's settings.

Tests

  • On Azure, every entry passed between 2026-11-17 08:26 and 2026-11-18 12:35 UTC: 76 entries in 26 sample folders, that is 26 script deployments plus the second identity script of the four managed-identity samples, 23 Bicep and 23 Terraform deployments. Each run deployed one sample with one method into its own ls_test_ai_* resource group, checked that every resource reached Succeeded, called every app, ran validate.sh and the sample's tests, read the telemetry, logs and metrics back with query-telemetry.sh and query-logs-and-metrics.sh, and deleted the group. 40 entries passed after an earlier failure, and each of those failures is one of the fixes above.
  • On the emulator (localstack/localstack-azure:latest), all 76 entries passed between 2026-11-16 and 2026-11-18, with the deploy and test commands that run-samples.sh registers. The last fixes were proven again on 2026-11-18: the Event Hubs pipeline (the restart and the metric export) with three script deployments, the Bicep and the Terraform deployment, on the latest image, published on 2026-11-18 with the SMF-1171 fix, two at a time; and Front Door's waits, on the image before it.
  • On the image before it, two Event Hubs samples on one emulator each lost their 15 Kafka payments to the other's payments event hub, the cross-namespace lookup that SMF-1171 fixed. On the latest image they ran side by side and passed.
  • function-app-service-bus/dotnet on Flex Consumption, on 2026-11-20: its Bicep and Terraform deployments passed on Azure, each in its own ls_test_ai_* resource group, deleted afterwards, and on the emulator with a build that runs Flex Consumption apps, which the next emulator release brings.
  • This PR's CI runs every entry on the emulator.
  • Upgrading a Terraform deployment of the version on main, on 2026-11-20. For each of the ten configurations with a moved.tf, the version on main was deployed with its own deploy.sh, then this branch's version was applied over the same Terraform state with its deploy.sh, followed by validate.sh, the sample's tests and both query scripts. The plans moved every resource of the earlier version into its module and destroyed or replaced none, and every output of the earlier version kept its value:
    • On LocalStack for Azure, all ten. function_app_url of the two function samples is the exception by design: it now reports the host name the emulator serves, where the earlier version built an azurewebsites.net address (on Azure the two are the same). web-app-sql-database ran on an emulator build that keeps no lifetime action on a certificate whose policy sends an empty list, as Azure does (SMF-1184): on the released emulator its upgrade plans to change the certificate's lifetime action, which that emulator refuses; the next emulator release brings the fix.
    • On Azure, eight: api-management-function-app, eventhubs-eventgrid, function-app-managed-identity/python, function-app-storage-http/dotnet, both web-app-managed-identity and both web-app-sql-database. The version on main of url-shortener and of eventhubs cannot complete a deployment on Azure: url-shortener's RBAC key vault gives the deploying principal no role, so writing its secrets is refused with 403, and eventhubs' key vault names the all-zeros tenant. On Azure these two are proven by fresh deployments of this branch.
    • In two of five upgrade runs of web-app-sql-database/dotnet on Azure, az webapp deploy reported "Site failed to start" ten minutes after the new package was already running and answering requests: Azure had restarted the old app for the new app setting just before the deployment, that restart had failed, and the deployment's status counted it. The other three runs deployed without that error.
  • After the last changes to the shared scripts, on 2026-11-20, the Bicep and the Azure CLI deployments of url-shortener and api-management-function-app passed on Azure again, every step, and this branch's Terraform deployment of each sample passed on Azure as well.
  • The other thirteen Terraform configurations this PR changes were already built from modules on main. Checked statically: every resource address of the version on main still exists in this branch's version, and no resource name changed.

Related

  • closes SMF-1152
  • closes SMF-1158
  • The emulator gaps these runs found are fixed in the emulator, all merged: SMF-1160, SMF-1161, SMF-1167, SMF-1170, SMF-1171 and SMF-1172.
  • Moving the two Linux Consumption function apps to Flex Consumption is SMF-1159.
  • The emulator fix the web-app-sql-database upgrade needs is SMF-1184.
  • The Azurite pin removal follows Keep DNS enabled and fix Azure sample deployment compatibility #153 (SMF-1175) and the emulator's Shared Key signing fix (SMF-1176).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FvNuJJJYAeH1hHK85hbq27

paolosalvatori and others added 30 commits November 16, 2026 14:23
26 deploy, cleanup, validate and pipeline scripts in aci-blob-storage, container-apps-blob-storage, eventhubs,
eventhubs-eventgrid and web-app-app-configuration were tracked without the executable bit (100644), unlike the rest of
the repository's scripts. Their content is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
… and function app pilot samples

The first samples of the Application Insights program (SMF-1152): web-app-managed-identity in Python and .NET,
function-app-managed-identity in Python and function-app-storage-http in .NET. Work in progress: the emulator and
Azure runs of the function apps' scripts are still being completed.

- A workspace-based Application Insights resource and its Log Analytics workspace in the three deployment methods,
  with APPLICATIONINSIGHTS_CONNECTION_STRING set on the apps. The web apps send their telemetry through the
  Microsoft OpenTelemetry Distro (microsoft-opentelemetry 1.6.0, Microsoft.OpenTelemetry 1.2.0); the function apps'
  Functions host sends it without code changes.
- Diagnostic settings that send the apps' resource logs and platform metrics, and their plans' metrics, to the
  workspace, in the three methods; validate.sh lists them.
- query-telemetry.sh and query-logs-and-metrics.sh read the telemetry, logs and metrics back; run-samples.sh runs
  them.
- The function apps run on a Linux B1 App Service plan with Always On in the three methods: the Linux Consumption plan
  supports Python up to 3.12 and .NET up to 9 ("Supported languages in Azure Functions"). The .NET sample no longer
  sets WEBSITE_CONTENTAZUREFILECONNECTIONSTRING, which a dedicated plan doesn't use and Azure refuses without
  WEBSITE_CONTENTSHARE, and its scripts name the function app as its Bicep and Terraform modules do.
- The READMEs describe the monitoring, and their copies of validate.sh match the scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
Fixes for what the Azure runs of the function app pilot samples found:

- On Azure the first `az functionapp deploy` to a new function app on a B1 plan timed out (504 GatewayTimeout) while
  its deployment site started, and no deployment was recorded; a second attempt succeeded. The seven deploy scripts
  now make up to three attempts, 30 seconds apart, with --async true so that the az CLI polls the deployment instead
  of holding one request open, and they all exit with "Failed" when every attempt fails: function-app-storage-http's
  Bicep script did not check the deployment at all, and its Terraform script only warned.
- function-app-storage-http deploys its published .NET output, which needs no remote build ("Deployment technologies
  in Azure Functions"), but Azure ran an Oryx build on it from the scripts and failed: SCM_DO_BUILD_DURING_DEPLOYMENT
  is now false in the three methods, where Bicep and Terraform set it to true.
- function-app-managed-identity's test.sh waited 50 seconds for the processed blob, where Azure's blob trigger took
  52: it now waits up to 3 minutes, RETRY_COUNT and SLEEP override the wait, and the README's copy of the script and
  its output match it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…ic settings and custom telemetry

Bicep and Terraform create every resource through a module, like web-app-app-configuration: the Log Analytics
workspace, Application Insights, the storage account with its blob container, the App Service plan, the web app, the
user-assigned identity and the role assignment. Each module that owns a resource with diagnostic settings creates them:
the web app and the plan as before, the storage account (transaction metrics), its blob service (StorageRead,
StorageWrite and StorageDelete logs, and transaction metrics), and the workspace itself (query audit). The Application
Insights resource has none: Azure refuses a destination that is the workspace it's based on.

The scripts create the same diagnostic settings, stop printing the storage account key, create the container without
anonymous access (Azure refuses it on a new storage account), assign the role by object id, and report a failed role
assignment as failed. The web apps send custom events for the activities added, updated and deleted, count them in a
custom metric, log the exceptions they catch, and tell the user when an operation failed. query-telemetry.sh adds an
activity and reads the events, the metric and the exceptions; query-logs-and-metrics.sh reads the blob logs, the
storage metrics and the query audit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
… READMEs for the monitoring

The storage account and its blob service export the Capacity and Transaction metric categories: with Transaction alone
the LocalStack emulator exports no storage metrics, while both are exported on Azure as well. validate.sh lists the
diagnostic settings of the storage account, of its blob service and of the workspace, and no longer prints an error
for the user-assigned identity of a deployment that uses the system-assigned one. The READMEs describe the modules,
the custom events, the custom metric, the exceptions, and the diagnostic settings of every resource that offers them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
… diagnostic settings for the storage services

function-app-managed-identity/python and function-app-storage-http/dotnet create every resource through a module in
Bicep and Terraform, like web-app-managed-identity, with a function app module that sets AzureWebJobsStorage itself.
The storage account module creates the diagnostic settings of the account and of the blob, queue and table services
that the Functions host and the functions use, and the workspace audits its own queries.

The function apps use OpenTelemetry with Azure Functions (telemetryMode in host.json): the Python worker sends the
telemetry of the function (PYTHON_APPLICATIONINSIGHTS_ENABLE_TELEMETRY and azure-monitor-opentelemetry), and the .NET
worker uses the Azure Monitor exporter. The functions send custom events (BlobProcessed, GameCreated,
GameWinnerDetermined) and a custom metric (processed_blobs, games_completed). The Python app keeps only the warnings of
the Azure SDK and urllib3 loggers, whose HTTP request records would fill the traces.

The scripts create the same diagnostic settings, stop printing the storage account key and the connection string,
read the storage endpoints from the account instead of building them, assign the roles by object id and report a
failed role assignment as failed; the Bicep deploy script prints the names of the app settings, not their values. The
query scripts read the custom events, the custom metric, the exceptions, the storage logs and metrics, and the query
audit. WEBSITE_STORAGE_ACCOUNT_CONNECTION_STRING, which no code read, is gone from the .NET sample.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…er, and metrics Azure exports

The Python worker sends the records of the function_app logger only (PYTHON_APPLICATIONINSIGHTS_LOGGER_NAME, which the
worker passes to configure_azure_monitor): with the root logger it also sent the HTTP requests of the Azure SDK and of
the exporter itself, and the exporter's startup messages about optional instrumentations arrived as exceptions.

The .NET sample uses Microsoft.Azure.Functions.Worker 2.52.0: Microsoft.Azure.Functions.Worker.OpenTelemetry 1.2.0
pulls Worker.Core 2.52.0, and with Worker 2.51.0 every invocation failed with a MissingMethodException.

The query scripts read any platform metric of the function app from AzureMetrics: Azure exports its memory, I/O and HTTP
metrics but not FunctionExecutionCount (observed on 2026-11-16), which they still read from the metrics API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…s, and diagnostic settings on every resource

Bicep and Terraform create an Application Insights resource through a module and hand its connection string to the web
app (APPLICATIONINSIGHTS_CONNECTION_STRING), as the Azure CLI script does. In all three methods the workspace audits
the queries run on it (Audit, LAQueryLogs), and the NAT Gateway and its public IP send their logs and metrics.

The Python app uses the Microsoft OpenTelemetry Distro, the .NET app Microsoft.OpenTelemetry with Npgsql tracing: the
requests, the calls to App Configuration, Key Vault and PostgreSQL, the log records, the logged exceptions, the
ActivityAdded, ActivityUpdated and ActivityDeleted custom events and the activities custom metric.
scripts/query-telemetry.sh reads that telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting.

validate.sh and the Bicep and Terraform deploy scripts list the app settings by name only: a value can be a
connection string.

Proven on the emulator with the three methods in both languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…ead of aborting

On Azure, the first start of the .NET app failed: creating the blob container answered 403 AuthorizationFailure more
than 13 minutes after the identity got Storage Blob Data Contributor, the app's single attempt threw, and the process
aborted (exit code 134). The same call two minutes later answered 409 ContainerAlreadyExists. The initializer now
retries for up to two minutes, as the database samples' initializers do, within the 230 seconds App Service waits for
a container to start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…n Insights

Paolo's updated architecture images and Visio files of the samples that now send their telemetry to Application
Insights: web-app-managed-identity and web-app-app-configuration (Python and .NET), function-app-managed-identity
(Python) and function-app-storage-http (.NET).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
… apps, and the server's audit log

Bicep and Terraform create an Application Insights resource through a module and hand its connection string to the web
app (APPLICATIONINSIGHTS_CONNECTION_STRING), as the Azure CLI script does. The server turns its audit log on
(audit_log_enabled, audit_log_events=CONNECTION), and its diagnostic setting writes the audit and slow query logs to
their resource-specific tables (MySqlAuditLogs, MySqlSlowLogs). The firewall rule and the two parameters are set one
after the other: the server refuses a change while another one runs (ServerIsBusy).

The Python app uses the Microsoft OpenTelemetry Distro with the PyMySQL instrumentation, the .NET app
Microsoft.OpenTelemetry with the MySqlConnector activity source: the requests, the calls to MySQL, the log records, the
logged exceptions, the ActivityAdded, ActivityUpdated and ActivityDeleted custom events and the activities custom
metric. scripts/query-telemetry.sh reads that telemetry back, and query-logs-and-metrics.sh shows every diagnostic
setting and what it delivered.

validate.sh checks the Application Insights resource, and the deploy scripts list the app settings by name only: a
value can be a password or a connection string.

Proven on the emulator with the three methods in both languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…rd NAT Gateway has no flow logs

Azure refuses the NatGatewayFlowlogsV1 category on the Standard NAT Gateway the samples deploy (400 "Category
'NatGatewayFlowlogsV1' is not supported.", recorded on 2026-11-16 with the three deployment methods of
web-app-app-configuration), and lists AllMetrics as its only category: NAT Gateway flow logs are only available for a
StandardV2 NAT Gateway (Microsoft Learn, "Analyze NAT Gateway traffic with flow logs"). The scripts, the Bicep modules
and the Terraform modules of web-app-app-configuration and web-app-mysql-flexible-server keep AllMetrics.

The LocalStack emulator accepts the category, which is how the samples passed there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…n the apps, and the server log in its own table

Bicep and Terraform create an Application Insights resource through a module and hand its connection string to the web
app (APPLICATIONINSIGHTS_CONNECTION_STRING), as the Azure CLI script does. The server's diagnostic setting writes its
log to the resource-specific PGSQLServerLogs table (Dedicated) in all three methods. The NAT Gateway's diagnostic
setting sends its metrics only: Azure refuses NatGatewayFlowlogsV1 on a Standard NAT Gateway.

The Python app uses the Microsoft OpenTelemetry Distro, whose psycopg2 instrumentation traces the queries, the .NET app
Microsoft.OpenTelemetry with Npgsql.OpenTelemetry: the requests, the calls to PostgreSQL, the log records, the logged
exceptions, the ActivityAdded, ActivityUpdated and ActivityDeleted custom events and the activities custom metric.
scripts/query-telemetry.sh reads that telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting and
what it delivered.

The Azure CLI script creates its firewall rule with --server-name and --name, the flags of Azure CLI 2.93, with which
the old ones created no rule. validate.sh checks the Application Insights resource, and the deploy scripts list the app
settings by name only: a value can be a password or a connection string.

Proven on the emulator with the three methods in both languages, before the NAT Gateway change, which only removes a
log category.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…ps, and the account's request logs

The Azure CLI script creates a Log Analytics workspace and a workspace-based Application Insights resource, hands its
connection string to the web app (APPLICATIONINSIGHTS_CONNECTION_STRING), and gives the Cosmos DB account, the web app,
its App Service plan and the workspace a diagnostic setting each. The account's setting writes the data plane and
control plane requests to their resource-specific tables (CDBDataPlaneRequests, CDBControlPlaneRequests).

The Python app uses the Microsoft OpenTelemetry Distro, whose Azure SDK instrumentation traces the calls to Cosmos DB,
the .NET app Microsoft.OpenTelemetry with the distributed tracing of the Cosmos DB client turned on (off by default):
the requests, the calls to Cosmos DB, the log records, the logged exceptions, the ActivityAdded, ActivityUpdated and
ActivityDeleted custom events and the activities custom metric. scripts/query-telemetry.sh reads that telemetry back,
and query-logs-and-metrics.sh shows every diagnostic setting and what it delivered.

The script no longer prints the account's primary key, its connection string or the app settings: validate.sh and the
script list the app settings by name only.

Proven on the emulator in both languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…apps, and the account's request logs

The Azure CLI script, Bicep and Terraform create a workspace-based Application Insights resource through modules and
hand its connection string to the web app (APPLICATIONINSIGHTS_CONNECTION_STRING). Every resource that supports
diagnostic settings sends its logs and metrics to the Log Analytics workspace: the Cosmos DB account writes its MongoDB
and control plane requests to the resource-specific tables (CDBMongoRequests, CDBControlPlaneRequests), the web app
its request, console and platform logs, and the virtual network, the network security groups, the NAT gateway, its
public IP prefix, the App Service plan and the workspace itself their own categories and metrics. A Standard NAT
gateway offers metrics only: NatGatewayFlowlogsV1 is for StandardV2 gateways.

The Python app uses the Microsoft OpenTelemetry Distro and the OpenTelemetry instrumentation of PyMongo, which the
distro doesn't include; the .NET app uses Microsoft.OpenTelemetry and listens to the activity source with which the
MongoDB driver traces its commands. Both send the requests, the calls to the database, the log records, the logged
exceptions, the activity custom events and the activities custom metric. scripts/query-telemetry.sh reads that
telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting and what it delivered.

Proven on the emulator in both languages with the Azure CLI script, Bicep and Terraform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…d the registry's events

The Azure CLI script, Bicep and Terraform create a workspace-based Application Insights resource through modules and
hand its connection string to the web app (APPLICATIONINSIGHTS_CONNECTION_STRING). Every resource that supports
diagnostic settings sends its logs and metrics to the Log Analytics workspace: the container registry its repository
and login events, the web app its request, console and platform logs, and the virtual network, the network security
groups, the NAT gateway, its public IP prefix, the App Service plan and the workspace itself their own categories and
metrics. A Standard NAT gateway offers metrics only: NatGatewayFlowlogsV1 is for StandardV2 gateways.

Both apps, built into the image the registry holds, send the requests, the log records, the logged exceptions, a
StatusRequested custom event for each status request and the status_requests custom metric: the Python one through the
Microsoft OpenTelemetry Distro, the .NET one through Microsoft.OpenTelemetry. scripts/query-telemetry.sh reads that
telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting and what it delivered. A web app created
with its image, as Terraform creates it, starts its container before its diagnostic setting exists, so the query of
the platform events runs once and says so when it finds none.

Proven on the emulator in both languages with the Azure CLI script, Bicep and Terraform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…d the database's logs and metrics

The Azure CLI script, Bicep and Terraform create a workspace-based Application Insights resource through modules and
hand its connection string to the web app (APPLICATIONINSIGHTS_CONNECTION_STRING). Every resource that supports
diagnostic settings sends its logs and metrics to the Log Analytics workspace: the SQL database its nine diagnostic
log categories and its three metric categories (Basic, InstanceAndAppAdvanced, WorkloadManagement), plus its audit
records through the database's auditing with Azure Monitor as its target; the Key Vault its audit and policy
evaluation logs; the web app its request, console and platform logs; and the App Service plan and the workspace itself
their own categories and metrics. The logical server gets no setting: Microsoft documents no platform metrics for it,
and its auditing goes through the master database.

Both apps send the requests, the calls to the database, the log records, the logged exceptions, the ActivityAdded,
ActivityUpdated and ActivityDeleted custom events and the activities custom metric: the Python one through the
Microsoft OpenTelemetry Distro, the .NET one through Microsoft.OpenTelemetry. scripts/query-telemetry.sh reads that
telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting and what it delivered.

Proven on the emulator in both languages with the Azure CLI script, Bicep and Terraform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…ion, and Front Door's access logs

The Azure CLI script creates a workspace-based Application Insights resource and hands its connection string to the
function app (APPLICATIONINSIGHTS_CONNECTION_STRING). Every resource that supports diagnostic settings sends its logs
and metrics to the Log Analytics workspace: the Front Door profile its access, health probe and web application
firewall logs, the function app its FunctionAppLogs, the storage account and its blob service their transactions and
blob logs, and the App Service plan and the workspace itself their own categories and metrics.

The function sends its requests, log records, logged exceptions, a CatalogItemServed custom event for each catalog
item it serves and the catalog_items_served custom metric through OpenTelemetry (host.json telemetryMode). The script
writes AzureWebJobsStorage again with the core.windows.net suffix: az functionapp create builds it from the storage
suffix of the current cloud, which carries a port on the emulator that the Functions host can't parse.
scripts/query-telemetry.sh reads the telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting and
what it delivered.

Proven on the emulator with the Azure CLI script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…tions, and the namespace's logs

The Azure CLI script, Bicep and Terraform create a workspace-based Application Insights resource through modules and
hand its connection string to the function app (APPLICATIONINSIGHTS_CONNECTION_STRING). Every resource that supports
diagnostic settings sends its logs and metrics to the Log Analytics workspace: the Service Bus namespace its
operational, diagnostic error, runtime audit and application metrics logs, the function app its FunctionAppLogs and
authentication logs, the storage account and its blob service their transactions and blob logs, and the virtual
network, the two network security groups, the NAT gateway, its public IP prefix, the App Service plan and the
workspace itself their own categories and metrics.

The functions send their requests, log records, logged exceptions, the GreetingRequested, GreetingProcessed and
GreetingReceived custom events and the greetings custom metric through Microsoft.Azure.Functions.Worker.OpenTelemetry
and the Azure Monitor exporter (host.json telemetryMode). Terraform writes AzureWebJobsStorage with the
core.windows.net suffix, since the provider's connection string carries the emulator's port, which the Functions host
can't parse. scripts/query-telemetry.sh reads the telemetry back, and query-logs-and-metrics.sh shows every diagnostic
setting and what it delivered; nothing uses the queues and tables of the storage account, so their logs are read once.

Proven on the emulator with the Azure CLI script, Bicep and Terraform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
samples/function-app-storage-http/python ports the six functions of the .NET version to the Python v2 programming
model, with the same triggers and bindings (HTTP, blob, queue, table, timer), the same app settings and the same
entities. The Azure CLI script, Bicep and Terraform come from the .NET version with the Python runtime and a remote
build. Like the .NET version, each creates a Log Analytics workspace, a workspace-based Application Insights resource
and diagnostic settings on the storage account, its blob service, the function app, the App Service plan and the
workspace, all through modules in Bicep and Terraform. The functions send their requests, log records, logged
exceptions, the GameCreated and GameWinnerDetermined custom events and the games_completed custom metric through the
OpenTelemetry support of the Python worker (host.json telemetryMode); scripts/query-telemetry.sh and
query-logs-and-metrics.sh read them back. The README reuses the .NET version's images.

The .NET README's sections on Application Insights and on logs and metrics predated the custom events, the metric and
the storage diagnostic settings, and now describe them. run-samples.sh and the samples table list the Python version.

Proven on the emulator with the Azure CLI script, Bicep and Terraform.

Refs SMF-1158

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
samples/function-app-managed-identity/dotnet ports the Python function to the .NET isolated worker: a blob trigger
reads each text blob of the input container with a strict UTF-8 decoder and writes it in uppercase to the output
container, both through the identity-based STORAGE_ACCOUNT_CONNECTION_STRING connection; a blob it can't process is
logged as an exception. The function sends its requests, log records, the BlobProcessed custom event and the
processed_blobs custom metric through Microsoft.Azure.Functions.Worker.OpenTelemetry and the Azure Monitor exporter
(host.json telemetryMode).

Both Azure CLI scripts (system-assigned and user-assigned identity), Bicep and Terraform come from the Python version
with the dotnet-isolated 10 runtime and a dotnet publish step instead of a remote build. Like the Python version, each
creates a Log Analytics workspace, a workspace-based Application Insights resource and diagnostic settings on every
resource that supports them, through modules in Bicep and Terraform; scripts/query-telemetry.sh and
query-logs-and-metrics.sh read them back. The README reuses the Python version's images. run-samples.sh and the
samples table list the .NET version.

Proven on the emulator with both Azure CLI scripts, Bicep and Terraform.

Refs SMF-1158

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…y resource's logs

The Azure CLI script, Bicep and Terraform create a workspace-based Application Insights resource through modules and
hand its connection string to the web app and the worker function app (APPLICATIONINSIGHTS_CONNECTION_STRING). Every
resource that supports diagnostic settings sends its logs and metrics to the Log Analytics workspace: the web app its
request, console, platform and other logs, the function app its FunctionAppLogs, the key vault its audit and policy
evaluation logs, the PostgreSQL flexible server its server logs, the Service Bus namespace its operational, network,
diagnostic error and application metrics logs, the storage account its metrics and its blob, queue and table services
the logs of their requests, and the App Service plan and the workspace itself their own categories and metrics. The
Standard namespace leaves out the runtime audit logs, which Service Bus writes only in the Premium tier.

The web app turns on the Microsoft OpenTelemetry Distro before it imports Flask and psycopg2, and sends its requests,
its calls to the Azure services and to PostgreSQL, its log records, the exceptions it logs, the LinkCreated and
LinkFollowed custom events and the links custom metric. The worker sends its invocations, log records, a LinkScanned
custom event and the link_scans custom metric through OpenTelemetry (host.json telemetryMode).
scripts/query-telemetry.sh reads that telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting and
what it delivered.

Proven on the emulator with the Azure CLI script, Bicep and Terraform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…unction, and the service's metrics

The Azure CLI script, Bicep and Terraform create a workspace-based Application Insights resource through modules and
hand its connection string to the function app (APPLICATIONINSIGHTS_CONNECTION_STRING). Every resource that supports
diagnostic settings sends its logs and metrics to the Log Analytics workspace: the API Management service its metrics,
plus the record of every request through the gateway (GatewayLogs) on the tiers that collect resource logs, which
Consumption, the sample's tier, doesn't; the function app its FunctionAppLogs; the storage account its metrics and its
blob, queue and table services the logs of their requests; and the App Service plan and the workspace itself their own
categories and metrics.

The function sends its requests, log records, the exceptions it logs, an InventoryItemServed custom event for each
item it serves and the inventory_items_served custom metric through OpenTelemetry (host.json telemetryMode). The
script writes AzureWebJobsStorage again with the core.windows.net suffix: az functionapp create builds it from the
storage suffix of the current cloud, which carries a port on the emulator that the Functions host can't parse.
scripts/query-telemetry.sh reads the telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting and
what it delivered.

Proven on the emulator with the Azure CLI script, Bicep and Terraform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…shboard, and the pipeline's logs

The Azure CLI script, Bicep and Terraform create a workspace-based Application Insights resource and hand its
connection string to the fraud detection function and to the dashboard web app
(APPLICATIONINSIGHTS_CONNECTION_STRING); Terraform now creates every resource through a module, as Bicep does. Every
resource that supports diagnostic settings sends its logs and metrics to the Log Analytics workspace, each setting
created right after its resource in the script: the Event Hubs namespace its operational, Capture and eight other log
categories, the key vault its audit and policy evaluation logs, the function app and the web app their own logs, the
storage account its metrics and its blob, queue and table services the logs of their requests, and the two App Service
plans and the workspace itself their own categories and metrics. The Standard namespace leaves out the runtime audit
logs, which Event Hubs writes only in the Premium and Dedicated tiers.

The function sends its invocations, log records, the exceptions it logs (an invalid payment among them), a
FraudDetected custom event for each alert and the payments_screened custom metric through OpenTelemetry (host.json
telemetryMode). The dashboard turns on the Microsoft OpenTelemetry Distro before it imports Flask and sends its
requests, its calls to Event Hubs, Blob Storage and the Schema Registry, its records such as OVERVIEW, and the
exceptions it logs when a part of the pipeline can't be read. It now reaches the Schema Registry on the host and port
that serve the REST APIs, as the producers do, instead of the AMQP port of the connection string on the emulator; on
Azure it needs a token for it, which the deployments don't give the web app, and the README says so.
scripts/query-telemetry.sh reads the telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting and
what it delivered.

The key vault uses Azure RBAC, so the deploying principal now gets the Key Vault Secrets Officer role before writing
the secrets, in all three methods, and Terraform reads the tenant id from the client configuration.

Proven on the emulator with the Azure CLI script, Bicep and Terraform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
… and the pipeline's logs

The Azure CLI script, Bicep and Terraform create a workspace-based Application Insights resource through modules and
hand its connection string to the function app (APPLICATIONINSIGHTS_CONNECTION_STRING). Every resource that supports
diagnostic settings sends its logs and metrics to the Log Analytics workspace: the Event Hubs namespace its
operational, Capture and eight other log categories, the Event Grid system topic the deliveries its subscription fails
to make, the function app its FunctionAppLogs, the storage account its metrics and its blob, queue and table services
the logs of their requests, and the Consumption plan and the workspace itself their own categories and metrics. The
Standard namespace leaves out the runtime audit logs, which Event Hubs writes only in the Premium and Dedicated tiers.

The function sends its invocations, log records, the exceptions it logs, a DeviceSummarized custom event for each
device summary and the readings_processed custom metric through OpenTelemetry (host.json telemetryMode).
scripts/query-telemetry.sh reads that telemetry back, and query-logs-and-metrics.sh shows every diagnostic setting and
what it delivered.

Proven on the emulator with the Azure CLI script, Bicep and Terraform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
On Azure, a new diagnostic setting can drop for good the records of its first minutes, and the secret reads of an
app's start are among them: the key vault query of web-app-sql-database ran 10 minutes on Azure without a SecretGet
record. query-logs-and-metrics.sh of the web apps that read their secrets at start (web-app-sql-database,
web-app-app-configuration, url-shortener) now restarts the web app and calls it before that query, and eventhubs
reads its secrets again, as validate.sh does right after the deployment. The wait for the web app becomes a function
of the script, since the restart waits the same way.

Proven on the emulator with the scripts deployment of each of the six samples: the query finds the reads that follow
the restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…he web app's certificate

The Bicep deploy.sh creates the certificate the web app serves HTTPS with in the key vault after the deployment, since
Bicep cannot create a Key Vault certificate, but the vault's access policies named only the web app and the SQL server.
On Azure the deploying principal was refused: "does not have certificates create permission on key vault". The Azure
CLI script gets that permission from az keyvault create, and Terraform names the deployer
(azurerm_client_config.current.object_id). deploy.sh now resolves the deployer's object id as the other samples' Bicep
scripts do (Microsoft Graph, then the access token's oid claim) and passes it as deployerPrincipalId, and the vault
gives it the certificate permissions get, list and create; an empty id gives it no policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
On Azure the scripts of function-app-managed-identity/dotnet failed their deployment: Kudu ran an Oryx build of the
already published package ("Running oryx build...", then "Deployment Failed"), as the scripts of
function-app-storage-http/dotnet had on 2026-11-16, while their Bicep and Terraform deployments, which create the app
with SCM_DO_BUILD_DURING_DEPLOYMENT=false, passed. The scripts set that setting after az functionapp create, and the
deployment site had not seen it yet when az functionapp deploy published. On Linux, az functionapp deployment source
config-zip sets SCM_DO_BUILD_DURING_DEPLOYMENT to false and waits until the deployment site sees it, as
function-app-service-bus/dotnet already deploys, so the three .NET scripts now deploy with it, keeping their retry for
the 504 of a deployment site that is still starting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…l the app stores it

On Azure, right after its Terraform deployment, web-app-sql-database/python answered query-telemetry.sh's post of a new
activity with 405 in 11 ms, while its two reads of the page before answered 200 and the app's own route takes the
post: the app was not yet the one answering, so the ActivityAdded event and the activities metric never came. The
fourteen query-telemetry.sh scripts of the web app samples that add an activity now read the form and post it again,
every SLEEP seconds up to RETRY_COUNT times, until the app answers 302.

Proven on the emulator with web-app-sql-database/python and web-app-app-configuration/dotnet (the antiforgery token).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…n Insights in every web app and function app sample

Paolo's Visio files and PNG renderings for the 21 sample folders, the two new samples
(function-app-managed-identity/dotnet, function-app-storage-http/python) included, with their own copies of the
screenshots, and the Visio files the Cosmos DB NoSQL .NET and MySQL samples lacked. web-app-custom-image's Visio file is
now architecture.vsdx, as in the other samples.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJLnFr1VZDBLJPCsqPP
…ange

build-matrix.sh runs with pipefail and matched each infrastructure file and each sample's watch folder with echo "$CHANGED" | grep -q. When the list of changed files is longer than a pipe buffer, grep -q exits at its first match, echo dies of SIGPIPE writing the rest, and pipefail turns the match into a failure. A pull request with many changed files therefore ran only the samples whose match happened to come late: this branch's 1014 changed files selected 27 of the 124 jobs, although run-samples.sh, run-samples.yml and build-matrix.sh all changed. The matches now read the list from a here-string, which no pipe stands between, and keep their substring semantics. test_infra_change_in_a_large_diff_runs_every_sample changes the workflow among 2000 other files and expects every sample; it failed before the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NGfV8XqFJXssjuCoVLmMgS
paolosalvatori and others added 11 commits November 18, 2026 20:31
…le-less version

The ten Terraform samples whose resources this branch moves from main.tf into modules get a moved.tf with a moved block for each earlier resource (120 in all), generated from Terraform's plan over a deployment of main's version. On the emulator, planning this version over such a deployment moves every resource and deletes none; url-shortener replaces only its storage account, whose name gets shorter, and what belongs to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NGfV8XqFJXssjuCoVLmMgS
… its key vault

The script, the Bicep deployment and the earlier Terraform keep Azure's default; the module's 7 days made an upgrade fail, because a vault's retention can't change once set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NGfV8XqFJXssjuCoVLmMgS
…endpoint on its Azure host

LocalStack for Azure answers Azure requests on azure.localhost.localstack.cloud,
the host every other sample's metadata_host names; on the bare
localhost.localstack.cloud the provider's metadata discovery now gets a 404 and
terraform plan fails before it starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJHNupTSwZFsBBZsUrF
…umption plan when asked

The Bicep template and the Terraform configuration offered the FlexConsumption tier and the FC1 SKU, and neither
could create a function app on that plan: Azure refuses FUNCTIONS_WORKER_RUNTIME there, and such an app takes its
runtime and its deployment storage from functionAppConfig. With skuTier FlexConsumption and skuName FC1 (Bicep) or
sku_name FC1 (Terraform), the function app now gets a functionAppConfig (Terraform: azurerm_function_app_flex_consumption)
with its runtime, its scale settings and its deployment storage, a blob container of its storage account, and leaves
out the settings the plan replaced. A moved block keeps the Linux function app of an existing Terraform state in place.
Terraform delegates the function app subnet to Microsoft.App/environments on that plan, as the Bicep template already
did. The default stays a Standard S1 plan.

With the user-assigned identity, a Flex Consumption app also gets SERVICE_BUS_CONNECTION_STRING__credential set to
managedidentity and SERVICE_BUS_CONNECTION_STRING__clientId set to the identity's client id: without them its Service
Bus trigger uses the system-assigned identity, the default ("Configure an identity-based connection", Azure Functions
developer guide), which the app doesn't have, and on Azure the input queue was never drained.

The deploy scripts keep deploying with config-zip, the command Microsoft documents for Flex Consumption; az functionapp
deploy answers 415 on a Flex Consumption app on Azure. On that plan config-zip ends with a health check that accepts the
app's default host name only without a port, so on LocalStack it fails after the deployment succeeded: the scripts then
read the status of the deployment itself. query-logs-and-metrics.sh reads OnDemandFunctionExecutionCount on that plan,
which defines no FunctionExecutionCount, and shows the plan's metrics once, without waiting for them: Azure records
none for a Flex Consumption plan.

The Bicep README's configuration example showed another sample's parameters; it now shows this sample's, and both
READMEs say how to choose the Flex Consumption plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJJJYAeH1hHK85hbq27
…eir modules

api-management-function-app's product_id output repeated the literal "inventory-partners" since the product moved into
the api_management module, so it would no longer follow the product's id; the module now outputs the id of the product
it creates, and the root output reads it, as main's output read the product resource. The capture_container_name output
of eventhubs and eventhubs-eventgrid took the first of the storage module's containers; it now takes the single one
with one(), which fails instead of answering another container if the module ever gets a second.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJJJYAeH1hHK85hbq27
…fmt writes it

terraform fmt -check refused both files: their equal signs were aligned with more spaces than the longest name needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJJJYAeH1hHK85hbq27
Revert 5c64089, which shortened the name part from urlshortstorage to urlstorage. With the samples' prefix and suffix,
five and four characters ("local" and "test", or the runner's l and four letters), the name is 24 characters, Azure's
limit, so it never needed shortening; and a new name is a new storage account: upgrading a deployment of main's version
would replace it, losing the links table, the QR codes and the queued jobs (Terraform plans a delete and a create;
Bicep and the Azure CLI scripts create a second account and point the apps at it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJJJYAeH1hHK85hbq27
… host is azure.localhost.localstack.cloud

f183c73 moved deploy.sh and providers.tf to azure.localhost.localstack.cloud:4566, the host LocalStack for Azure answers
the provider's metadata discovery on; the README's commands for running terraform directly still named the bare
localhost.localstack.cloud:4566, where that discovery gets a 404 and terraform plan fails before it starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJJJYAeH1hHK85hbq27
…alidate.sh

The keyless call is the script's first call to the gateway. On Azure, right after an upgrade of a deployment, it got no
answer within curl's ten seconds (HTTP 000) and failed the check, while the next calls, a second later, were answered at
once. A call with no answer at all is now repeated, up to 12 times and 5 seconds apart; any HTTP answer ends the wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJJJYAeH1hHK85hbq27
…ing made by the earlier version

The earlier version's deploy.sh created the storage account's "default" diagnostic setting with the Azure CLI, outside
the Terraform state; the storage_account module now manages a setting of that name. Upgrading such a deployment failed
at the plan: "a resource with the ID .../storageAccounts/<name>|default already exists - to be managed via Terraform
this resource needs to be imported into the State". deploy.sh now imports the setting when the state has a storage
account but not the setting, and Azure or the emulator has it, so that the plan updates it in place; a new deployment
has no state and skips the step. The Bicep and Azure CLI deployments keep the name "default" and put the setting with
a PUT, which updates it.

Also: the two output values only the removed CLI step read are no longer read, and the README lists jq and zip, which
the script uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJJJYAeH1hHK85hbq27
…invocation records

On Azure the FunctionAppLogs of a fresh deployment stayed empty through two ten-minute waits on 2026-11-20, although
Application Insights had recorded four invocations of each function: the records of a new diagnostic setting's first
minutes can be lost, and query-logs-and-metrics.sh only called the web app's home page, so a second run waited for the
same lost records. It now shortens a link of its own before that query, so that the AbuseScan and QrGenerator functions
run again after the setting's first minutes, as it already restarts the web app before it reads the key vault's records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJJJYAeH1hHK85hbq27

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants