Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,622 changes: 721 additions & 901 deletions appservice/package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions appservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@
},
"devDependencies": {
"@azure/core-client": "^1.7.2",
"@microsoft/vscode-azext-eng": "1.0.0-alpha.8",
"@microsoft/vscode-azext-eng": "^1.1.0-alpha.1",
"@types/fs-extra": "^9.0.13",
"@types/node": "22.x",
"@types/p-retry": "^2.0.0",
"@types/vscode": "1.105.0",
"@types/ws": "^8.5.3",
"@types/yazl": "^2.4.2",
"@vscode/test-cli": "*",
"@vscode/test-electron": "*"
"@vscode/test-electron": "*",
"tsx": "*"
},
"overrides": {
"serialize-javascript": "^7.0.5"
Expand Down
6 changes: 3 additions & 3 deletions appservice/src/SiteClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export class SiteClient implements IAppSettingsClient {
const dr = { ...r };
dr.receivedTime = new Date(r.received_time);
return dr;
}) as KuduModels.DeployResult[];
});
}

// the ARM call doesn't give all of the metadata we require so ping the scm directly
Expand Down Expand Up @@ -436,7 +436,7 @@ export class SiteClient implements IAppSettingsClient {
le.logTime = new Date(obj.log_time);
le.detailsUrl = obj.details_url;
return le;
}) as KuduModels.LogEntry[];
});
}

// no equivalent ARM call
Expand All @@ -456,7 +456,7 @@ export class SiteClient implements IAppSettingsClient {
le.logTime = new Date(e.log_time);
le.detailsUrl = e.details_url;
return le;
}) as KuduModels.LogEntry[];
});
}

public async vfsGetItem(context: IActionContext, url: string): Promise<AzExtPipelineResponse> {
Expand Down
4 changes: 2 additions & 2 deletions appservice/src/TunnelProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class TunnelProxy {
} catch (error) {
const parsedError: IParsedError = parseError(error);
ext.outputChannel.appendLog(`[Tunnel] Checking status, error: ${parsedError.message}`);
throw new Error(l10n.t('Error getting tunnel status: {0}', parsedError.errorType));
throw new Error(l10n.t('Error getting tunnel status: {0}', parsedError.errorType), { cause: error });
}

if (tunnelStatus.state === AppState.STARTED) {
Expand Down Expand Up @@ -171,7 +171,7 @@ export class TunnelProxy {
return;
} catch (error) {
if (!(error instanceof RetryableTunnelStatusError)) {
throw new Error(l10n.t('Unable to establish connection to application: {0}', parseError(error).message));
throw new Error(l10n.t('Unable to establish connection to application: {0}', parseError(error).message), { cause: error });
} // else allow retry
}

Expand Down
2 changes: 1 addition & 1 deletion appservice/src/createAppService/AppInsightsListStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class AppInsightsListStep extends AzureWizardPromptStep<IAppServiceWizard

public static async isNameAvailable(context: IAppServiceWizardContext, name: string): Promise<boolean> {
const components: ApplicationInsightsComponent[] = await AppInsightsListStep.getAppInsightsComponents(context);
return !components.some((ai: ApplicationInsightsComponent) => ai.name !== undefined && ai.name.toLowerCase() === name.toLowerCase());
return !components.some((ai: ApplicationInsightsComponent) => ai.name?.toLowerCase() === name.toLowerCase());
}

public async prompt(context: IAppServiceWizardContext): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion appservice/src/createAppService/AppServicePlanSkuStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type ExtendedSkuDescription = SkuDescription & { label?: string; description?: s

export class AppServicePlanSkuStep extends AzureWizardPromptStep<IAppServiceWizardContext> {
public async prompt(context: IAppServiceWizardContext): Promise<void> {
let skus: ExtendedSkuDescription[] = [];
let skus: ExtendedSkuDescription[];
if (await this.isPV4Region(context)) {
skus = context.advancedCreation ? this.pv4RecommendedSkus().concat(this.getAdvancedSkus()) : this.pv4RecommendedSkus();
} else {
Expand Down
2 changes: 1 addition & 1 deletion appservice/src/deploy/runWithZipStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function runWithZipStream(context: IActionContext, options: {
options.progress?.report({ message: creatingZip });

const zipFile: yazl.ZipFile = new yazl.ZipFile();
let filesToZip: string[] = [];
let filesToZip: string[];
let sizeOfZipFile: number = 0;

const zipByteCounter = new PassThrough();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class DelayFirstWebAppDeployStep extends AzureWizardExecuteStep<InnerDepl
}

const asp: AppServicePlan | undefined = await context.aspPromise;
if (!asp?.sku?.tier || asp.sku.tier.toLowerCase() !== 'basic') {
if (asp?.sku?.tier?.toLowerCase() !== 'basic') {
resolve();
}
if (!context.site.isLinux) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { Site } from "@azure/arm-appservice";
import { RequestBodyType, createHttpHeaders, createPipelineRequest } from "@azure/core-rest-pipeline";
import { createHttpHeaders, createPipelineRequest } from "@azure/core-rest-pipeline";
import { AzExtPipelineResponse, AzExtRequestPrepareOptions, createGenericClient } from "@microsoft/vscode-azext-azureutils";
import { publisherName } from "../../../constants";
import { InnerDeployContext } from "../../IDeployContext";
Expand All @@ -18,7 +18,7 @@ export class DeployFlexExecuteStep extends DeployZipBaseExecuteStep {

const RemoteBuild: boolean = site.properties?.functionAppConfig?.runtime.name === 'python';
const callback = async (zipStream: NodeJS.ReadableStream) => {
return await kuduClient.flexDeploy(context, (() => zipStream) as RequestBodyType, {
return await kuduClient.flexDeploy(context, (() => zipStream), {
RemoteBuild,
Deployer: publisherName
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { RequestBodyType } from "@azure/core-rest-pipeline";
import { AzExtPipelineResponse } from "@microsoft/vscode-azext-azureutils";
import { publisherName } from "../../../constants";
import { InnerDeployContext } from "../../IDeployContext";
Expand All @@ -14,7 +13,7 @@ export class DeployZipPushExecuteStep extends DeployZipBaseExecuteStep {
public async deployZip(context: InnerDeployContext): Promise<AzExtPipelineResponse | void> {
const kuduClient = await context.site.createClient(context);
const callback = async (zipStream: NodeJS.ReadableStream) => {
return await kuduClient.zipPushDeploy(context, (() => zipStream) as RequestBodyType, {
return await kuduClient.zipPushDeploy(context, (() => zipStream), {
author: publisherName,
deployer: publisherName,
isAsync: true,
Expand Down
2 changes: 1 addition & 1 deletion appservice/src/remoteDebug/remoteDebugCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function reportMessage(message: string, progress: vscode.Progress<{ messa
export async function setRemoteDebug(context: IActionContext, isRemoteDebuggingToBeEnabled: boolean, confirmMessage: string, noopMessage: string | undefined, site: ParsedSite, siteConfig: SiteConfigResource, progress: vscode.Progress<{ message: string }>, token: vscode.CancellationToken, learnMoreLink?: string): Promise<void> {
const client = await site.createClient(context);
const state: string | undefined = await client.getState();
if (state && state.toLowerCase() === 'stopped') {
if (state?.toLowerCase() === 'stopped') {
throw new Error(vscode.l10n.t('The app must be running, but is currently in state "Stopped". Start the app to continue.'));
}

Expand Down
2 changes: 1 addition & 1 deletion appservice/src/utils/appServiceEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function getAppServiceCredentials(subscription: ISubscriptionContex
await subscription.authentication?.getSessionWithScopes?.(scopes, { createIfNone: true });

return {
credentials: await subscription.createCredentialsForScopes(scopes) as TokenCredential,
credentials: await subscription.createCredentialsForScopes(scopes),
scopes,
};
}
3 changes: 1 addition & 2 deletions appservice/src/utils/azureUtils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See LICENSE in the project root for license information.
Comment thread
bwateratmsft marked this conversation as resolved.
*--------------------------------------------------------------------------------------------*/

import type { CheckNameAvailabilityResponse } from "@azure/arm-appservice";
Expand Down
1 change: 0 additions & 1 deletion appservice/test/getDeployFsPath.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ suite("getDeployFsPath", () => {
test(testFolder.name, async () => {
const context = await createTestActionContext();
const actual = await context.ui.runWithInputs(getInputs(testFolder), async () => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return await getDeployFsPath(context, getTarget(testFolder));
});
assert.strictEqual(path.basename(actual.originalDeployFsPath), testFolder.name);
Expand Down
Loading
Loading