Skip to content

[App Service] az webapp troubleshoot status: Provide latest application startup attempt data#33673

Merged
yanzhudd merged 28 commits into
Azure:devfrom
aamos-company:developer/amberamos/troubleshootcommand
Jul 24, 2026
Merged

[App Service] az webapp troubleshoot status: Provide latest application startup attempt data#33673
yanzhudd merged 28 commits into
Azure:devfrom
aamos-company:developer/amberamos/troubleshootcommand

Conversation

@aamos-company

@aamos-company aamos-company commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Related command

az webapp troubleshoot status

Description

Introduces the az webapp troubleshoot status command for diagnosing Linux web apps without leaving the terminal.

az webapp troubleshoot status

Reports per-instance runtime health and recent startup outcomes for a Linux web app.

Data sources

• Site Runtime Status — ARM GET .../sites/{name}[/slots/{slot}]/siteStatus[/{instanceId}]?api-version=2024-11-01
• Per-instance startup summary — KuduLite GET https://{scm-host}/api/startuplogs/summary[?instance={id}]
• Machine-name ↔ ARM hex id mapping — ARM /instances , so --instance accepts either form.

What it surfaces

• Per-instance State + Details, LastError / LastErrorDetails / LastErrorTimestamp (hidden for Started instances or when there have been no failed startups in the report window), and the last 24h Succeeded / Failed / most-recent-attempt counts.
• Handles KuduLite SummaryFetchStatus failures gracefully (missing startup summary is reported per instance, not silently zeroed).
• Correlates orphan startup entries (instances the log endpoint knows about but ARM no longer lists) so nothing is dropped.

Testing Guide
Images attached in the comments

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

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Tests
⚠️ None ️✔️ 130/130
⚠️AzureCLI-BreakingChangeTest
⚠️appservice
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd webapp troubleshoot sub group webapp troubleshoot added

@azure-client-tools-bot-prd

Copy link
Copy Markdown
Validation for Azure CLI Full Test Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi @aamos-company,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd

Copy link
Copy Markdown
Validation for Breaking Change Starting...

Thanks for your contribution!

@aamos-company
aamos-company marked this pull request as draft June 29, 2026 21:23
@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 Jun 29, 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.

@aamos-company aamos-company changed the title Create Troubleshoot Command for Linux [App Service] az webapp troubleshoot: provide latest application startup attempt data Jun 29, 2026

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.

Pull request overview

This PR extends the App Service command module with new runtime-status troubleshooting capabilities by introducing a webapp status command (ARM siteStatus) and a preview webapp troubleshoot status command (ARM siteStatus + SCM startup summary), plus associated help, params, and tests.

Changes:

  • Add az webapp status to fetch per-instance Site Runtime Status (ARM siteStatus), including --instance filtering and table formatting.
  • Add preview az webapp troubleshoot status to combine ARM runtime status with SCM startup summary, rendered as a human-readable report for table output.
  • Add scenario + mocked tests and a new recording; update HISTORY entry.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/azure-cli/HISTORY.rst Adds history note for the new az webapp status command.
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py Adds live scenario coverage for az webapp status.
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py Adds mocked unit tests for troubleshoot status, webapp status, and output transform behavior.
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/recordings/test_webapp_status.yaml Adds VCR recording for the new scenario test.
src/azure-cli/azure/cli/command_modules/appservice/custom.py Implements show_webapp_status, troubleshoot_status, formatting, and status-tip logging.
src/azure-cli/azure/cli/command_modules/appservice/commands.py Registers new commands and table transformers.
src/azure-cli/azure/cli/command_modules/appservice/_params.py Adds --instance parameter wiring for webapp status and webapp troubleshoot status.
src/azure-cli/azure/cli/command_modules/appservice/_help.py Adds help for webapp status and the preview webapp troubleshoot group/command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py Outdated
@yonzhan

yonzhan commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

App Service

@aamos-company aamos-company changed the title [App Service] az webapp troubleshoot: provide latest application startup attempt data [App Service] az webapp troubleshoot status: provide latest application startup attempt data Jul 1, 2026
@aamos-company
aamos-company requested review from a team as code owners July 22, 2026 14:26
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Comment thread src/azure-cli/HISTORY.rst Outdated
Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/appservice/_params.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/appservice/_help.py
Comment thread src/azure-cli/azure/cli/command_modules/appservice/_troubleshoot_status_report.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/appservice/custom.py Outdated
@Pan-Qi

Pan-Qi commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

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

@yanzhudd

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

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

@yanzhudd

Copy link
Copy Markdown
Contributor

@yanzhudd yanzhudd changed the title [App Service] az webapp troubleshoot status: provide latest application startup attempt data [App Service] az webapp troubleshoot status: Provide latest application startup attempt data Jul 24, 2026
@yanzhudd

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

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

@yanzhudd
yanzhudd merged commit eb35a5f into Azure:dev Jul 24, 2026
48 checks passed
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.

8 participants