Skip to content

Commit 070139b

Browse files
Merge main into nat/esbuild-test-migration2 and resolve package-lock.json conflict
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2 parents 42e6734 + a0fd2a0 commit 070139b

File tree

19 files changed

+975
-977
lines changed

19 files changed

+975
-977
lines changed

package-lock.json

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

src/commands/addBinding/settingSteps/StorageTypePromptStep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class StorageTypePromptStep extends AzureWizardPromptStep<IFunctionWizard
4040

4141
if (!context.useStorageEmulator) {
4242
promptSteps.push(new StorageAccountListStep(
43-
{ kind: StorageAccountKind.Storage, performance: StorageAccountPerformance.Standard, replication: StorageAccountReplication.LRS },
43+
{ kind: StorageAccountKind.StorageV2, performance: StorageAccountPerformance.Standard, replication: StorageAccountReplication.LRS },
4444
{ kind: [StorageAccountKind.BlobStorage], learnMoreLink: 'https://aka.ms/T5o0nf' }
4545
));
4646
}

src/commands/addMIConnections/SettingsAddBaseStep.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,11 @@ async function addStorageConnectionsAndRoles(context: AddMIConnectionsContext, c
8484
addRole(context, scope, CommonRoleDefinitions.storageBlobDataOwner);
8585
addRole(context, scope, CommonRoleDefinitions.storageQueueDataContributor);
8686
}
87-
} catch (_e) {
88-
throw new Error(localize('invalidStorageConnectionString', 'Unexpected storage connection string format: {0}', connection.value));
87+
} catch (e) {
88+
throw new Error(
89+
localize('invalidStorageConnectionString', 'Unexpected storage connection string format: {0}', connection.value),
90+
{ cause: e },
91+
);
8992
}
9093

9194
}
@@ -106,8 +109,11 @@ async function addDocumentConnectionsAndRoles(context: AddMIConnectionsContext,
106109
},
107110
...getClientIdAndCredentialPropertiesForRemote(context, cosmosDbAccountName)
108111
);
109-
} catch (_e) {
110-
throw new Error(localize('invalidDocumentConnectionString', 'Unexpected DocumentDB connection string format: {0}', connection.value));
112+
} catch (e) {
113+
throw new Error(
114+
localize('invalidDocumentConnectionString', 'Unexpected DocumentDB connection string format: {0}', connection.value),
115+
{ cause: e }
116+
);
111117
}
112118
}
113119

@@ -142,8 +148,11 @@ async function addEventHubServiceBusConnectionsAndRoles(context: AddMIConnection
142148
addRole(context, scope, CommonRoleDefinitions.azureServiceBusDataReceiver);
143149
}
144150
}
145-
} catch (_e) {
146-
throw new Error(localize('invalidEventHubConnectionString', 'Unexpected EventHub connection string format: {0}', connection.value));
151+
} catch (e) {
152+
throw new Error(
153+
localize('invalidEventHubConnectionString', 'Unexpected EventHub connection string format: {0}', connection.value),
154+
{ cause: e }
155+
);
147156
}
148157
}
149158

src/commands/appSettings/connectionSettings/azureWebJobsStorage/StorageConnectionListStep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class StorageConnectionListStep<T extends IStorageConnectionWizardContext
7474
if (!(context as IStorageAzureConnectionWizard).storageAccount) {
7575
promptSteps.push(new StorageAccountListStep(
7676
{ // INewStorageAccountDefaults
77-
kind: StorageAccountKind.Storage,
77+
kind: StorageAccountKind.StorageV2,
7878
performance: StorageAccountPerformance.Standard,
7979
replication: StorageAccountReplication.LRS
8080
},

src/commands/appSettings/connectionSettings/sqlDatabase/azure/SqlDatabaseCreateStep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class SqlDatabaseCreateStep<T extends ISqlDatabaseAzureConnectionWizardCo
4949
);
5050
ext.outputChannel.appendLog(customErrMessage);
5151
ext.outputChannel.appendLog(perr.message);
52-
throw new Error(customErrMessage);
52+
throw new Error(customErrMessage, { cause: e });
5353
}
5454
}
5555

src/commands/createFunction/openAPISteps/OpenAPICreateStep.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class OpenAPICreateStep extends AzureWizardExecuteStep<IFunctionWizardCon
9494
async function validateAutorestInstalled(context: IActionContext): Promise<void> {
9595
try {
9696
await cpUtils.executeCommand(undefined, undefined, 'autorest', composeArgs(withArg('--version'))());
97-
} catch (_error) {
97+
} catch (error) {
9898
const message: string = localize('autorestNotFound', 'Failed to find "autorest" | Extension needs AutoRest to generate a function app from an OpenAPI specification. Click "Learn more" for more details on installation steps.');
9999
if (!context.errorHandling.suppressDisplay) {
100100
void window.showErrorMessage(message, DialogResponses.learnMore).then(async result => {
@@ -105,7 +105,7 @@ async function validateAutorestInstalled(context: IActionContext): Promise<void>
105105
context.errorHandling.suppressDisplay = true;
106106
}
107107

108-
throw new Error(message);
108+
throw new Error(message, { cause: error });
109109
}
110110
}
111111

src/commands/createFunctionApp/createCreateFunctionAppComponents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export async function createCreateFunctionAppComponents(context: ICreateFunction
4848
const executeSteps: AzureWizardExecuteStep<IFunctionAppWizardContext>[] = [];
4949

5050
const storageAccountCreateOptions: INewStorageAccountDefaults = {
51-
kind: StorageAccountKind.Storage,
51+
kind: StorageAccountKind.StorageV2,
5252
performance: StorageAccountPerformance.Standard,
5353
replication: StorageAccountReplication.LRS
5454
};

src/commands/createFunctionApp/stacks/getStackPicks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ export interface eolWarningOptions {
293293
* This function checks the end of life date for stack and returns a message if the stack is end of life or will be end of life in 6 months.
294294
*/
295295
export async function getEolWarningMessages(context: ISubscriptionActionContext, options: eolWarningOptions): Promise<string> {
296-
let isEOL = false;
297-
let willBeEOL = false;
296+
let isEOL: boolean;
297+
let willBeEOL: boolean;
298298
let version: string | undefined;
299299
let displayInfo: {
300300
endOfLife: Date | undefined;

src/commands/createNewProject/mcpServerSteps/MCPDownloadSnippetsExecuteStep.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export class MCPDownloadSnippetsExecuteStep extends AzureWizardExecuteStepWithAc
3939
}
4040

4141
private async downloadFilesRecursively(context: MCPProjectWizardContext, items: GitHubFileMetadata[], basePath: string): Promise<void> {
42-
for (const item of items) {
42+
// Download all files and directories at this level in parallel
43+
await Promise.all(items.map(async (item) => {
4344
if (item.type === 'file') {
4445
await MCPDownloadSnippetsExecuteStep.downloadSingleFile({
4546
context, item,
@@ -59,7 +60,7 @@ export class MCPDownloadSnippetsExecuteStep extends AzureWizardExecuteStepWithAc
5960
// Recursively download directory contents
6061
await this.downloadFilesRecursively(context, dirContents, dirPath);
6162
}
62-
}
63+
}));
6364
}
6465

6566
public shouldExecute(context: MCPProjectWizardContext): boolean {

src/commands/deploy/deploy.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { type Site, type SiteConfigResource, type StringDictionary } from '@azure/arm-appservice';
6+
import { type Site, type SiteConfigResource } from '@azure/arm-appservice';
77
import { getDeployFsPath, getDeployNode, deploy as innerDeploy, showDeployConfirmation, type IDeployContext, type IDeployPaths, type InnerDeployContext, type ParsedSite } from '@microsoft/vscode-azext-azureappservice';
88
import { ResourceGroupListStep } from '@microsoft/vscode-azext-azureutils';
99
import { AzureWizard, DialogResponses, subscriptionExperience, type ExecuteActivityContext, type IActionContext, type ISubscriptionContext } from '@microsoft/vscode-azext-utils';
@@ -133,8 +133,11 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
133133
void showCoreToolsWarning(context, version, site.fullName);
134134

135135
const client = await site.createClient(actionContext);
136-
const siteConfig: SiteConfigResource = await client.getSiteConfig();
137-
const isConsumption: boolean = await client.getIsConsumption(actionContext);
136+
// Parallelize independent read-only calls: site config and consumption check
137+
const [siteConfig, isConsumption] = await Promise.all([
138+
client.getSiteConfig(),
139+
client.getIsConsumption(actionContext),
140+
]);
138141
let isZipDeploy: boolean = siteConfig.scmType !== ScmType.LocalGit && siteConfig.scmType !== ScmType.GitHub;
139142
if (!isZipDeploy && site.isLinux && isConsumption) {
140143
ext.outputChannel.appendLog(localize('linuxConsZipOnly', 'WARNING: Using zip deploy because scm type "{0}" is not supported on Linux consumption', siteConfig.scmType), { resourceName: site.fullName });
@@ -167,9 +170,11 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
167170
context.deployMethod = 'flexconsumption';
168171
}
169172

170-
const appSettings: StringDictionary = await client.listApplicationSettings();
171-
172-
const durableStorageType: DurableBackend | undefined = await durableUtils.getStorageTypeFromWorkspace(language, context.projectPath);
173+
// Parallelize remote app settings fetch and local workspace durable storage detection
174+
const [appSettings, durableStorageType] = await Promise.all([
175+
client.listApplicationSettings(),
176+
durableUtils.getStorageTypeFromWorkspace(language, context.projectPath),
177+
]);
173178
context.telemetry.properties.durableStorageType = durableStorageType;
174179

175180
if (durableStorageType === DurableBackend.SQL && isFlexConsumption) {

0 commit comments

Comments
 (0)