Skip to content

Let the telemetry check of the web app and API Management samples run on Windows - #159

Merged
paolosalvatori merged 1 commit into
mainfrom
smf-1296-samples-the-telemetry-check-fails-on-windows-for
Dec 4, 2026
Merged

paolosalvatori merged 1 commit into
mainfrom
smf-1296-samples-the-telemetry-check-fails-on-windows-for

Conversation

@paolosalvatori

@paolosalvatori paolosalvatori commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

In Samples CI run 47263761045, the first Windows run since #154, 28 of the 99 Windows jobs failed; all 136 Linux jobs passed.

26 of them failed in the query-telemetry.sh scripts, which hand curl a temporary file made with mktemp. In Git Bash, curl is a Windows program, and MSYS_NO_PATHCONV=1, which the README asks Windows users to set, keeps Git Bash from converting the /tmp/... path, so curl cannot open it:

  • 23 web-app-*/dotnet jobs. curl could not save the antiforgery cookie of the app's form, so the post that adds an activity arrived without it, and ASP.NET Core answered 400 to all 30 attempts. The Python apps check no such token, so they passed.
  • 3 api-management-function-app/python jobs. curl could not open the --dump-header file and gave up before sending the request, so the script read status 000.

The other 2, servicebus/java/scripts and container-apps-blob-storage/python/scripts with MANAGED_IDENTITY_TYPE=UserAssigned, never ran a sample. Their runner stopped answering while WSL 2 was being set up, a hypervisor fault GitHub reproduced on Windows Server 2025 runners (actions/runner-images#14938). A re-run lands on another VM.

Fixes SMF-1296

Changes

  • The 15 query-telemetry.sh scripts that hand curl a temporary file, in the 14 web app samples (.NET and Python) and in API Management, convert its path with native_path, the cygpath -m function validate.sh and call-api.sh already use. On Linux and macOS, which have no cygpath, the path is unchanged.

Tests

  • Windows 11, Git Bash with MSYS_NO_PATHCONV=1. The post_activity and call_api functions of all 15 scripts ran against a local server that requires the antiforgery cookie and, like the gateway, answers 429 with Retry-After before 200. Before the change, every post got 400 and the gateway call 000. After it, every post got 302 with the cookie, and the gateway call got 429, waited, then 200.
  • Linux bash. The same functions got the same answers before and after the change.
  • Samples CI on this branch, every sample on Linux (amd64 and arm64) and Windows: run 47281004100 passed all 235 test jobs: 99 on Linux amd64, 37 on Linux arm64 and 99 on Windows, including the 26 that failed before. One Windows job of a sample this PR doesn't change, function-app-storage-http/python/scripts, lost its runner while WSL 2 was being set up (actions/runner-images#14938) and passed when re-run.
  • Azure, each of the 15 changed samples deployed with its Azure CLI scripts in its own resource group, deleted afterwards: query-telemetry.sh, run from Windows Git Bash with MSYS_NO_PATHCONV=1 and the Windows Azure CLI, passed in all 15.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01FvNuJJKcAASYSAqWH2cusA

… on Windows

In Git Bash, curl is a Windows program, and MSYS_NO_PATHCONV=1, which the README asks Windows users to set, keeps Git Bash from converting the /tmp/... path that mktemp returns, so curl could not open the files query-telemetry.sh gave it. The .NET web apps answered 400 to every new activity, whose post arrived without the antiforgery cookie curl had failed to save, and the API Management script read status 000 from a curl that could not open its --dump-header file.

The 15 query-telemetry.sh scripts that hand curl a temporary file now convert its path with native_path, the cygpath -m function validate.sh and call-api.sh already use; on Linux and macOS the path is unchanged.

Fixes SMF-1296

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FvNuJJKcAASYSAqWH2cusA
@paolosalvatori
paolosalvatori requested a review from a team as a code owner December 4, 2026 06:24
Copilot AI balanced review requested due to automatic review settings December 4, 2026 06:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the Windows temporary-file path handling changes.

No open issues 🎉

What changed in this PR

Fixes Windows temporary-file handling in the telemetry checks introduced by #154, allowing curl to access cookie and response-header files when MSYS_NO_PATHCONV=1.

Changes:

  • Adds native_path using cygpath -m when available, leaving paths unchanged otherwise.
  • Converts curl’s cookie-file paths in 14 web app scripts and its header-file path in the API Management script.
File Description
samples/​web-app-sql-database/​python/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-sql-database/​dotnet/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-postgresql-flexible-server/​python/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-postgresql-flexible-server/​dotnet/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-mysql-flexible-server/​python/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-mysql-flexible-server/​dotnet/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-managed-identity/​python/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-managed-identity/​dotnet/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-cosmosdb-nosql-api/​python/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-cosmosdb-nosql-api/​dotnet/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-cosmosdb-mongodb-api/​python/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-cosmosdb-mongodb-api/​dotnet/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-app-configuration/​python/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​web-app-app-configuration/​dotnet/​scripts/​query-telemetry.sh Converts curl cookie-file paths.
samples/​api-management-function-app/​python/​scripts/​query-telemetry.sh Converts curl’s response-header file path.

Review effort: Balanced

@paolosalvatori
paolosalvatori merged commit b84e67c into main Dec 4, 2026
530 of 531 checks passed
@paolosalvatori
paolosalvatori deleted the smf-1296-samples-the-telemetry-check-fails-on-windows-for branch December 4, 2026 10:52

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