Skip to content

azure devops utf8 file based requests

Kazushi Kamegawa edited this page Sep 22, 2026 · 1 revision

Azure DevOps UTF-8 File-Based Requests

日本語

Summary

Use UTF-8 request files for Azure DevOps REST writes so Japanese and other non-ASCII text survives PowerShell and command-line handling on Windows. Keep the existing MCP-first access order.

Tracking

Type Issue
Parent Issue #66
Sub-issue Issue #67
Sub-issue Issue #68
Sub-issue Issue #69

Background

Inline JSON and non-ASCII command arguments can fail through PowerShell quoting and console encoding. A corrupted CLI display does not establish that stored Boards or Wiki content is corrupted; the saved value must be read back.

Design

  • On Windows, serialize structured JSON with ConvertTo-Json -InputObject, write a temporary UTF-8 file without a BOM, and send it with PowerShell 7 Invoke-RestMethod -InFile and the endpoint's content type. Remove the file in finally; keep credentials in request headers.
  • Use the same file flow for Boards JSON Patch arrays. Validate description source text, reject literal escaped newlines, render standard Boards descriptions as HTML rich text, and verify the stored representation. For Wiki, read Markdown from a UTF-8 file, wrap it in the JSON content field, retain ETag checks on updates, and compare the saved page with the source. The Wiki CLI uses --file-path and --encoding utf-8. Azure DevOps Wiki work item references use #<id>; preflight and readback reject AB#<id> in prose.
  • Validate GitHub issue body files before creation, rejecting literal escaped newlines outside code fences and accidental outer code fences. Read created issues back and compare their Markdown body with the source file.
  • Use request files with curl --data-binary in Linux/macOS Bash examples. Keep the plugins/azure-devops-toolkit skills and .github/skills mirrors synchronized, without overwriting unrelated worktree changes.

Implementation

  1. Add shared request-file guidance and paired PowerShell/Bash examples to the Azure DevOps foundation skill.
  2. Update Boards and Wiki write workflows, including Boards rich-text validation, Wiki #<id> work item references, the Windows execution reference, and Wiki concurrency/readback guidance.
  3. Replace inline JSON examples in the remaining REST skills and update CLI guidance for non-ASCII Boards and file-based Wiki writes. Add GitHub issue body-file validation and readback.

Verification

  • Test Japanese, emoji, quotes, backslashes, and newlines through JSON round trips and a local -InFile HTTP receiver; confirm a top-level JSON Patch array, UTF-8 without a BOM, content type, and exact Unicode payload.
  • Reject the literal escaped-newline example before an issue or work-item write; accept actual Japanese/emoji line breaks and validate Boards Markdown-to-HTML structure. Validate the Markdown-to-JSON Wiki envelope locally. Do not write test content to Azure DevOps.
  • Run skill and marketplace validation, git diff --check, and byte-for-byte mirror checks. Verify published Wiki pages and Home language links.

Clone this wiki locally