Skip to content

[AppService] Fix troubleshoot report rendering on Windows - #34206

Open
aamos-company wants to merge 8 commits into
Azure:devfrom
aamos-company:fix-appservice-troubleshoot-report-ascii
Open

aamos-company wants to merge 8 commits into
Azure:devfrom
aamos-company:fix-appservice-troubleshoot-report-ascii

Conversation

@aamos-company

@aamos-company aamos-company commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Related command
•  az webapp troubleshoot status
•  az webapp troubleshoot config

Description
Fixes Windows encoding failures in the human-readable App Service troubleshoot output.

• Replaces Unicode hint markers and box-drawing characters with ASCII-compatible equivalents.
• Prevents  UnicodeEncodeError  failures under legacy Windows encodings such as CP1252 and CP437.

• Limits startup records from instances that no longer host the application to five across all output formats, including JSON and YAML.
• Links to the resolved Kudu  /api/startuplogs/summary  endpoint for the full 24-hour history.
• Preserves slot and custom SCM endpoint behavior.
• Adds regression coverage for legacy Windows encodings, report truncation, structured output, and Kudu URL propagation.

Validation
• Appservice pylint and flake8 checks pass.
• Status and config troubleshoot test suites pass.
• Strict CP1252 and CP437 rendering tests pass.
Testing Guide

History Notes


This checklist is used to make sure that common guidelines for a pull request are followed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2d173c3e-9eaa-4c14-9f83-d6352e7f23bb
@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 9, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution aamos-company! We will review the pull request and get back to you soon.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Automated sensitive-information remediation ran on this pull request.

  • Detected categories: email address
  • Replaced with typed [REDACTED:category] placeholders in: PR description
  • Comment/review owners notified because X Engineering Agent cannot edit another user's text: none

X Engineering Agent does not modify source files. The PR creator must remove or replace each suspected value at the linked line:

  • No changed-file findings

If a credential was exposed, rotate or revoke it immediately. Detected values are never copied into this comment.

✅ Confirm the finding · ❌ Dispute the finding

GitHub only supports a fixed reaction set, so 👍 represents ✅ and 👎 represents ❌. The bot-created reactions are only poll choices.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2d173c3e-9eaa-4c14-9f83-d6352e7f23bb
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2d173c3e-9eaa-4c14-9f83-d6352e7f23bb
… reports

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2d173c3e-9eaa-4c14-9f83-d6352e7f23bb
… records

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2d173c3e-9eaa-4c14-9f83-d6352e7f23bb
@aamos-company
aamos-company marked this pull request as ready for review October 9, 2026 18:29
@aamos-company
aamos-company requested a review from a team as a code owner October 9, 2026 18:29
Copilot AI balanced review requested due to automatic review settings October 9, 2026 18:29
…Kudu

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2d173c3e-9eaa-4c14-9f83-d6352e7f23bb

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

The focused compatibility changes are covered by relevant regression tests and introduce no unresolved issues.

0 open findings

What changed in this PR

Fixes App Service troubleshoot report rendering on Windows terminals using legacy encodings.

Changes:

  • Replaces unsupported Unicode decorations with ASCII equivalents.
  • Limits orphan startup summaries to five entries.
  • Adds CP1252/CP437 regression tests.
File Description
commands.py Makes the table-output hint ASCII-safe.
_troubleshoot_status_report.py Uses ASCII formatting and caps orphan summaries.
_troubleshoot_config_report.py Replaces Unicode report decorations with ASCII.
test_webapp_commands_thru_mock.py Tests legacy encodings and orphan-summary limits.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

… all outputs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2d173c3e-9eaa-4c14-9f83-d6352e7f23bb
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2d173c3e-9eaa-4c14-9f83-d6352e7f23bb
from azure.cli.core.style import Style, print_styled_text


_MAX_ORPHAN_STARTUPS = 5

@aamos-company aamos-company Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now limit stale instances to 5 but provides link to view full summary. Special character removed before "Hint"

Image

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants