Skip to content

Commit fac4943

Browse files
appservice: Use reserved from list response for EP/WS plan OS detection (#2229)
* appservice: Use reserved from list response for EP/WS plans Remove per-plan GET requests for Elastic Premium and Workflow Standard plans when determining Linux vs Windows OS. The `reserved` property is now correctly returned by the list operation as of API version 2024-11-01+. The current SDK (@azure/arm-appservice v18.0.0) uses API version 2025-03-01. This eliminates N+1 API calls that could cause multi-minute delays when users have many EP/WS app service plans. Fixes #2129 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * bump version to 4.2.2 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0c34573 commit fac4943

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

appservice/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

appservice/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@microsoft/vscode-azext-azureappservice",
33
"author": "Microsoft Corporation",
4-
"version": "4.2.1",
4+
"version": "4.2.2",
55
"description": "Common tools for developing Azure App Service extensions for VS Code",
66
"tags": [
77
"azure",

appservice/src/createAppService/AppServicePlanListStep.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { AzExtLocation, LocationListStep, ResourceGroupListStep, uiUtils } from
88
import { AzureWizardPromptStep, IAzureQuickPickItem, IAzureQuickPickOptions, IWizardOptions, nonNullProp } from '@microsoft/vscode-azext-utils';
99
import * as vscode from 'vscode';
1010
import { webProvider } from '../constants';
11-
import { tryGetAppServicePlan } from '../tryGetSiteResource';
1211
import { createWebSiteClient } from '../utils/azureClients';
1312
import { AppKind, getWebsiteOSDisplayName, WebsiteOS } from './AppKind';
1413
import { AppServicePlanCreateStep } from './AppServicePlanCreateStep';
@@ -104,11 +103,10 @@ export class AppServicePlanListStep extends AzureWizardPromptStep<IAppServiceWiz
104103
let isPlanLinux: boolean = nonNullProp(plan, 'kind').toLowerCase().includes(WebsiteOS.linux);
105104

106105
if (plan.sku && (plan.sku.family === 'EP' || plan.sku.family === 'WS')) {
107-
// elastic premium plans and workflow standard plans do not have the os in the kind, so we have to check the "reserved" property
108-
// also, the "reserved" property is always "false" in the list of plans returned above. We have to perform a separate get on each plan
109-
const client: WebSiteManagementClient = await createWebSiteClient(context);
110-
const epPlan: AppServicePlan | undefined = await tryGetAppServicePlan(client, nonNullProp(plan, 'resourceGroup'), nonNullProp(plan, 'name'));
111-
isPlanLinux = !!epPlan?.reserved;
106+
// Elastic premium and workflow standard plans do not have the OS in the `kind` string,
107+
// so we check the `reserved` property instead. As of API version 2024-11-01+, `reserved`
108+
// is correctly returned by the list operation (no extra per-plan GET needed).
109+
isPlanLinux = !!plan.reserved;
112110
}
113111

114112
// plan.kind will contain "linux" for Linux plans, but will _not_ contain "windows" for Windows plans. Thus we check "isLinux" for both cases

0 commit comments

Comments
 (0)