Skip to content

Add confirmation prompt before Stop / Restart on production web apps #2897

Description

Summary

The appService.Stop and appService.Restart commands execute immediately with no confirmation dialog. In contrast, Delete and Swap Slots both confirm. Given that Stop/Restart cause user-facing downtime, they warrant the same protection — a mis-click in the tree view (Stop is directly adjacent to Restart in the context menu) can take a production site down.

Current behavior

src/commands/stopWebApp.ts and src/commands/restartWebApp.ts execute without prompting the user.

  • stopWebApp.ts calls client.stop() directly.
  • restartWebApp.ts chains appService.StopappService.Start.

No context.ui.showWarningMessage(..., DialogResponses.yes, DialogResponses.cancel) gate.

Proposed behavior

Wrap both commands with a warning-modal confirmation, matching the pattern already used in deleteWebApp.ts / swapSlots.ts:

const message = localize('confirmStop', 'Stop web app "{0}"? Traffic will be interrupted.', node.site.fullName);
await context.ui.showWarningMessage(message, { modal: true }, DialogResponses.yes, DialogResponses.cancel);

Optional: gate only on Production slot (skip prompt for staging/dev slots) to reduce friction while keeping the safety net where it matters.

Rationale

  • Parity with existing destructive-action UX (Delete, Swap Slots)
  • Prevents accidental production outages from mis-clicks in the tree context menu
  • Matches Azure Portal, which also confirms Stop / Restart

Happy to open a PR if the team agrees on the shape (unconditional prompt vs. production-slot-only).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions