Skip to content

Restart web app via native ARM restart instead of chaining Stop → Start - #2902

Draft
Alex Weininger (alexweininger) with Copilot wants to merge 2 commits into
mainfrom
copilot/use-native-restart-api
Draft

Restart web app via native ARM restart instead of chaining Stop → Start#2902
Alex Weininger (alexweininger) with Copilot wants to merge 2 commits into
mainfrom
copilot/use-native-restart-api

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

restartWebApp implemented Restart by chaining appService.Stop then appService.Start. This left the app Stopped whenever Start failed (transient ARM 5xx, throttling, network), and incurred a full deallocate/reallocate cold-start window rather than a worker recycle.

Changes

  • src/commands/restartWebApp.ts: replaced the Stop → Start command chaining with a direct native restart against WebSiteManagementClient, wrapped in the same runWithTemporaryDescription + output-channel logging pattern as startWebApp.ts / stopWebApp.ts.
  • Slot handling: dispatches to webApps.restartSlot when slotName is present, otherwise webApps.restart.

Note: the issue's suggested client.restart() on the SiteClient wrapper doesn't exist — that wrapper only exposes stop() / start() — so this uses the raw ARM client via createWebSiteClient, matching existing usage elsewhere in the extension.

const client = await createWebSiteClient([context, node.subscription]);
await node.runWithTemporaryDescription(context, localize('restarting', "Restarting..."), async () => {
    ext.outputChannel.appendLog(restartingApp);
    if (site.slotName) {
        await client.webApps.restartSlot(site.resourceGroup, site.siteName, site.slotName);
    } else {
        await client.webApps.restart(site.resourceGroup, site.siteName);
    }
    ext.outputChannel.appendLog(restartedApp);
});

Copilot AI changed the title [WIP] Fix restart command to use native restart API Restart web app via native ARM restart instead of chaining Stop → Start Jul 15, 2026
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.

Restart command should use the native restart API, not chain Stop → Start

2 participants