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
4 changes: 2 additions & 2 deletions .azure-pipelines/common/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
steps:
- task: NodeTool@0
displayName: 'Use Node 14.x'
displayName: 'Use Node 16.x'
inputs:
versionSpec: 14.x
versionSpec: 16.x

- task: Npm@1
displayName: 'npm ci'
Expand Down
2,650 changes: 1,292 additions & 1,358 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"icon": "resources/azure-functions.png",
"aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",
"engines": {
"vscode": "^1.78.0"
"vscode": "^1.79.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -1143,9 +1143,9 @@
"all": "npm i && npm run lint && npm test"
},
"devDependencies": {
"@azure/arm-resources": "^3.0.0",
"@azure/arm-resources": "^5.2.0",
"@microsoft/eslint-config-azuretools": "^0.1.0",
"@microsoft/vscode-azext-dev": "^0.1.5",
"@microsoft/vscode-azext-dev": "^2.0.0",
"@types/fs-extra": "^8.1.0",
"@types/gulp": "^4.0.10",
"@types/gulp-filter": "^3.0.33",
Expand All @@ -1154,7 +1154,7 @@
"@types/ps-tree": "^1.1.0",
"@types/request": "2.0.7",
"@types/semver": "^5.5.0",
"@types/vscode": "^1.66.0",
"@types/vscode": "1.79.0",
"@types/websocket": "^1.0.0",
"@types/xml2js": "^0.4.5",
"@types/xregexp": "4.3.0",
Expand Down Expand Up @@ -1182,18 +1182,21 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
"@azure/arm-appinsights": "^4.0.0",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly the App Insights SDK hasn't GA'd their Track 2 version. So we need to use an alpha build.

"@azure/arm-appinsights": "^5.0.0-alpha.20230530.1",
"@azure/arm-appservice": "^13.0.3",
"@azure/arm-cosmosdb": "^15.0.0",
"@azure/arm-eventhub": "^5.1.0",
"@azure/arm-servicebus": "^5.0.0",
"@azure/arm-sql": "^9.1.0",
"@azure/arm-storage": "^17.0.0",
"@azure/ms-rest-js": "^2.2.1",
"@azure/arm-storage": "^18.1.0",
"@azure/core-client": "^1.7.3",
"@azure/core-rest-pipeline": "^1.11.0",
"@azure/storage-blob": "^12.5.0",
"@microsoft/vscode-azext-azureappservice": "^0.8.1",
"@microsoft/vscode-azext-azureutils": "^0.3.7",
"@microsoft/vscode-azext-utils": "^0.4.0",
"@microsoft/vscode-azext-azureappservice": "^2.0.0",
"@microsoft/vscode-azext-azureappsettings": "^0.2.0",
"@microsoft/vscode-azext-azureutils": "^2.0.0",
"@microsoft/vscode-azext-utils": "^2.0.0",
"@microsoft/vscode-azureresources-api": "^2.0.4",
"escape-string-regexp": "^4.0.0",
"extract-zip": "^2.0.1",
"fs-extra": "^4.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*--------------------------------------------------------------------------------------------*/

import type { AuthorizationRule, EHNamespace } from "@azure/arm-eventhub";
import type { ResourceManagementModels } from "@azure/arm-resources";
import type { ResourceGroup } from "@azure/arm-resources";
import { ISubscriptionContext } from "@microsoft/vscode-azext-utils";
import { EventHubsConnectionTypeValues, StorageConnectionTypeValues } from "../../../../constants";
import { ISetConnectionSettingContext } from "../ISetConnectionSettingContext";

export interface IEventHubsConnectionWizardContext extends ISetConnectionSettingContext, Partial<ISubscriptionContext> {
resourceGroup?: ResourceManagementModels.ResourceGroup;
resourceGroup?: ResourceGroup;

// Connection Types
azureWebJobsStorageType?: StorageConnectionTypeValues;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { AccessKeys, AuthorizationRule, EventHubManagementClient, KnownAccessRights } from "@azure/arm-eventhub";
import type { StorageAccount, StorageAccountListKeysResult, StorageManagementClient } from "@azure/arm-storage";
import { getResourceGroupFromId, IStorageAccountWizardContext, uiUtils } from "@microsoft/vscode-azext-azureutils";
import { IStorageAccountWizardContext, getResourceGroupFromId, uiUtils } from "@microsoft/vscode-azext-azureutils";
import { ISubscriptionContext, nonNullProp, nonNullValue } from "@microsoft/vscode-azext-utils";
import { localSettingsFileName } from "../../../constants";
import { defaultDescription } from "../../../constants-nls";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import type { ResourceManagementModels } from '@azure/arm-resources';
import type { ResourceGroup } from '@azure/arm-resources';
import type { Database, Server } from '@azure/arm-sql';
import { ISubscriptionContext } from "@microsoft/vscode-azext-utils";
import { SqlDbConnectionTypeValues, StorageConnectionTypeValues } from "../../../../constants";
import { ISetConnectionSettingContext } from '../ISetConnectionSettingContext';

export interface ISqlDatabaseConnectionWizardContext extends ISetConnectionSettingContext, Partial<ISubscriptionContext> {
resourceGroup?: ResourceManagementModels.ResourceGroup;
resourceGroup?: ResourceGroup;

// Connection Types
azureWebJobsStorageType?: StorageConnectionTypeValues;
Expand Down
5 changes: 3 additions & 2 deletions src/commands/appSettings/downloadAppSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
*--------------------------------------------------------------------------------------------*/

import type { StringDictionary } from "@azure/arm-appservice";
import { AppSettingsTreeItem, confirmOverwriteSettings, IAppSettingsClient } from "@microsoft/vscode-azext-azureappservice";
import { confirmOverwriteSettings } from "@microsoft/vscode-azext-azureappservice";
import { AppSettingsTreeItem, IAppSettingsClient } from "@microsoft/vscode-azext-azureappsettings";
import { AzExtFsExtra, IActionContext } from "@microsoft/vscode-azext-utils";
import * as vscode from 'vscode';
import { functionFilter, localSettingsFileName } from "../../constants";
import { viewOutput } from "../../constants-nls";
import { ext } from "../../extensionVariables";
import { getLocalSettingsJson, ILocalSettingsJson } from "../../funcConfig/local.settings";
import { ILocalSettingsJson, getLocalSettingsJson } from "../../funcConfig/local.settings";
import { localize } from "../../localize";
import * as api from '../../vscode-azurefunctions.api';
import { decryptLocalSettings } from "./localSettings/decryptLocalSettings";
Expand Down
2 changes: 1 addition & 1 deletion src/commands/appSettings/toggleSlotSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AppSettingTreeItem } from "@microsoft/vscode-azext-azureappservice";
import { AppSettingTreeItem } from "@microsoft/vscode-azext-azureappsettings";
import { IActionContext } from "@microsoft/vscode-azext-utils";
import { functionFilter } from "../../constants";
import { ext } from "../../extensionVariables";
Expand Down
3 changes: 2 additions & 1 deletion src/commands/appSettings/uploadAppSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*--------------------------------------------------------------------------------------------*/

import type { StringDictionary } from "@azure/arm-appservice";
import { AppSettingsTreeItem, confirmOverwriteSettings, IAppSettingsClient } from "@microsoft/vscode-azext-azureappservice";
import { confirmOverwriteSettings } from "@microsoft/vscode-azext-azureappservice";
import { AppSettingsTreeItem, IAppSettingsClient } from "@microsoft/vscode-azext-azureappsettings";
import { AzExtFsExtra, IActionContext } from "@microsoft/vscode-azext-utils";
import * as vscode from 'vscode';
import { ConnectionKey, functionFilter, localEventHubsEmulatorConnectionRegExp, localSettingsFileName, localStorageEmulatorConnectionString } from "../../constants";
Expand Down
17 changes: 9 additions & 8 deletions src/commands/createFunctionApp/stacks/getStackPicks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { HttpOperationResponse, ServiceClient } from '@azure/ms-rest-js';
import { createGenericClient } from '@microsoft/vscode-azext-azureutils';
import { ServiceClient } from '@azure/core-client';
import { createPipelineRequest } from '@azure/core-rest-pipeline';
import { AzExtPipelineResponse, createGenericClient } from '@microsoft/vscode-azext-azureutils';
import { IAzureQuickPickItem, openUrl, parseError } from '@microsoft/vscode-azext-utils';
import { hiddenStacksSetting } from '../../../constants';
import { FuncVersion, funcVersionLink } from '../../../FuncVersion';
import { hiddenStacksSetting } from '../../../constants';
import { localize } from '../../../localize';
import { requestUtils } from '../../../utils/requestUtils';
import { getWorkspaceSetting } from '../../../vsCodeConfig/settings';
import { FullFunctionAppStack, IFunctionAppWizardContext } from '../IFunctionAppWizardContext';
import { backupStacks } from './backupStacks';
Expand Down Expand Up @@ -146,14 +148,13 @@ async function getStacks(context: IFunctionAppWizardContext & { _stacks?: Functi
let stacksArmResponse: StacksArmResponse;
try {
const client: ServiceClient = await createGenericClient(context, context);
const result: HttpOperationResponse = await client.sendRequest({
const result: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({
method: 'GET',
pathTemplate: '/providers/Microsoft.Web/functionappstacks',
queryParameters: {
url: requestUtils.createRequestUrl('/providers/Microsoft.Web/functionappstacks', {
'api-version': '2020-10-01',
removeDeprecatedStacks: String(!getWorkspaceSetting<boolean>('showDeprecatedStacks'))
}
});
}),
}));
stacksArmResponse = <StacksArmResponse>result.parsedBody;
} catch (error) {
// Some environments (like Azure Germany/Mooncake) don't support the stacks ARM API yet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { HttpOperationResponse } from '@azure/ms-rest-js';
import { AzExtPipelineResponse } from '@microsoft/vscode-azext-azureutils';
import { AzExtFsExtra, IActionContext } from '@microsoft/vscode-azext-utils';
import * as path from 'path';
import { Progress } from 'vscode';
Expand Down Expand Up @@ -111,7 +111,7 @@ export class PowerShellProjectCreateStep extends ScriptProjectCreateStep {
});

try {
const response: HttpOperationResponse = await requestUtils.sendRequestWithExtTimeout(context, { method: 'GET', url: this.azModuleGalleryUrl });
const response = await requestUtils.sendRequestWithExtTimeout(context, { method: 'GET', url: this.azModuleGalleryUrl });
const versionResult: string = this.parseLatestAzModuleVersion(response);
const [major]: string[] = versionResult.split('.');
return parseInt(major);
Expand All @@ -120,7 +120,7 @@ export class PowerShellProjectCreateStep extends ScriptProjectCreateStep {
}
}

private parseLatestAzModuleVersion(response: HttpOperationResponse): string {
private parseLatestAzModuleVersion(response: AzExtPipelineResponse): string {
/* eslint-disable */
const moduleInfo: any = response.parsedBody;
if (moduleInfo?.entry && Array.isArray(moduleInfo.entry)) {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/editAppSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AppSettingTreeItem } from '@microsoft/vscode-azext-azureappservice';
import { AppSettingTreeItem } from '@microsoft/vscode-azext-azureappsettings';
import { IActionContext } from '@microsoft/vscode-azext-utils';
import { functionFilter } from '../constants';
import { ext } from '../extensionVariables';
Expand Down
5 changes: 3 additions & 2 deletions src/commands/executeFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { createHttpHeaders } from '@azure/core-rest-pipeline';
import { SiteClient } from '@microsoft/vscode-azext-azureappservice';
import { IActionContext, parseError } from '@microsoft/vscode-azext-utils';
import { window } from 'vscode';
import { FuncVersion } from '../FuncVersion';
import { functionFilter } from '../constants';
import { ext } from '../extensionVariables';
import { FuncVersion } from '../FuncVersion';
import { localize } from '../localize';
import { FunctionTreeItemBase } from '../tree/FunctionTreeItemBase';
import { FuncHostRequest } from '../tree/IProjectTreeItem';
Expand Down Expand Up @@ -67,7 +68,7 @@ export async function executeFunction(context: IActionContext, node?: FunctionTr

let responseText: string | null | undefined;
await node.runWithTemporaryDescription(context, localize('executing', 'Executing...'), async () => {
const headers: { [name: string]: string | undefined } = {};
const headers = createHttpHeaders();
if (client) {
headers['x-functions-key'] = (await client.listHostKeys()).masterKey;
}
Expand Down
9 changes: 5 additions & 4 deletions src/commands/logstream/startStreamingLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { ApplicationInsightsManagementClient, ApplicationInsightsManagementModels } from '@azure/arm-appinsights';
import { ApplicationInsightsComponent, ApplicationInsightsManagementClient } from '@azure/arm-appinsights';
import { SiteLogsConfig, StringDictionary } from '@azure/arm-appservice';
import * as appservice from '@microsoft/vscode-azext-azureappservice';
import { ParsedSite } from '@microsoft/vscode-azext-azureappservice';
import { uiUtils } from '@microsoft/vscode-azext-azureutils';
import { AzExtTreeItem, DialogResponses, IActionContext } from '@microsoft/vscode-azext-utils';
import { functionFilter } from '../../constants';
import { ext } from '../../extensionVariables';
import { localize } from '../../localize';
import { SlotTreeItem, isSlotTreeItem } from '../../tree/SlotTreeItem';
import { RemoteFunctionTreeItem } from '../../tree/remoteProject/RemoteFunctionTreeItem';
import { isSlotTreeItem, SlotTreeItem } from '../../tree/SlotTreeItem';
import { createAppInsightsClient } from '../../utils/azureClients';
import { nonNullProp } from '../../utils/nonNull';
import { openUrl } from '../../utils/openUrl';
Expand Down Expand Up @@ -64,8 +65,8 @@ async function openLiveMetricsStream(context: IActionContext, site: ParsedSite,
throw new Error(localize('mustConfigureAI', 'You must configure Application Insights to stream logs on Linux Function Apps.'));
} else {
const aiClient: ApplicationInsightsManagementClient = await createAppInsightsClient([context, node.subscription]);
const components: ApplicationInsightsManagementModels.ApplicationInsightsComponentListResult = await aiClient.components.list();
const component: ApplicationInsightsManagementModels.ApplicationInsightsComponent | undefined = components.find(c => c.instrumentationKey === aiKey);
const components = await uiUtils.listAllIterator(aiClient.components.list());
const component: ApplicationInsightsComponent | undefined = components.find(c => c.instrumentationKey === aiKey);
if (!component) {
throw new Error(localize('failedToFindAI', 'Failed to find application insights component.'));
} else {
Expand Down
7 changes: 3 additions & 4 deletions src/commands/pickFuncProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { HttpOperationResponse } from '@azure/ms-rest-js';
import { AzExtRequestPrepareOptions, sendRequestWithTimeout } from '@microsoft/vscode-azext-azureutils';
import { IActionContext, UserCancelledError } from '@microsoft/vscode-azext-utils';
import * as unixPsTree from 'ps-tree';
import * as vscode from 'vscode';
import { hostStartTaskName } from '../constants';
import { IPreDebugValidateResult, preDebugValidate } from '../debug/validatePreDebug';
import { ext } from '../extensionVariables';
import { getFuncPortFromTaskOrProject, IRunningFuncTask, isFuncHostTask, runningFuncTaskMap, stopFuncTaskIfRunning } from '../funcCoreTools/funcHostTask';
import { IRunningFuncTask, getFuncPortFromTaskOrProject, isFuncHostTask, runningFuncTaskMap, stopFuncTaskIfRunning } from '../funcCoreTools/funcHostTask';
import { localize } from '../localize';
import { delay } from '../utils/delay';
import { requestUtils } from '../utils/requestUtils';
import { taskUtils } from '../utils/taskUtils';
import { getWindowsProcessTree, IProcessInfo, IWindowsProcessTree, ProcessDataFlag } from '../utils/windowsProcessTree';
import { IProcessInfo, IWindowsProcessTree, ProcessDataFlag, getWindowsProcessTree } from '../utils/windowsProcessTree';
import { getWorkspaceSetting } from '../vsCodeConfig/settings';

const funcTaskReadyEmitter = new vscode.EventEmitter<vscode.WorkspaceFolder>();
Expand Down Expand Up @@ -102,7 +101,7 @@ async function startFuncTask(context: IActionContext, workspaceFolder: vscode.Wo

try {
// wait for status url to indicate functions host is running
const response: HttpOperationResponse = await sendRequestWithTimeout(context, statusRequest, statusRequestTimeout, undefined);
const response = await sendRequestWithTimeout(context, statusRequest, statusRequestTimeout, undefined);
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
if (response.parsedBody.state.toLowerCase() === 'running') {
funcTaskReadyEmitter.fire(workspaceFolder);
Expand Down
7 changes: 4 additions & 3 deletions src/commands/registerCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AppSettingsTreeItem, AppSettingTreeItem, registerSiteCommand } from '@microsoft/vscode-azext-azureappservice';
import { AzExtParentTreeItem, AzExtTreeItem, IActionContext, registerCommand, registerCommandWithTreeNodeUnwrapping, unwrapArgs } from '@microsoft/vscode-azext-utils';
import { registerSiteCommand } from '@microsoft/vscode-azext-azureappservice';
import { AppSettingTreeItem, AppSettingsTreeItem } from '@microsoft/vscode-azext-azureappsettings';
import { AzExtParentTreeItem, AzExtTreeItem, IActionContext, registerCommand, registerCommandWithTreeNodeUnwrapping, unwrapTreeNodeCommandCallback } from '@microsoft/vscode-azext-utils';
import { commands } from "vscode";
import { ext } from '../extensionVariables';
import { installOrUpdateFuncCoreTools } from '../funcCoreTools/installOrUpdateFuncCoreTools';
Expand Down Expand Up @@ -100,7 +101,7 @@ export function registerCommands(): void {
registerCommandWithTreeNodeUnwrapping('azureFunctions.toggleAppSettingVisibility', async (context: IActionContext, node: AppSettingTreeItem) => { await node.toggleValueVisibility(context); }, 250);
registerCommandWithTreeNodeUnwrapping('azureFunctions.uninstallFuncCoreTools', uninstallFuncCoreTools);
registerCommandWithTreeNodeUnwrapping('azureFunctions.viewCommitInGitHub', viewCommitInGitHub);
registerSiteCommand('azureFunctions.viewDeploymentLogs', unwrapArgs(viewDeploymentLogs));
registerSiteCommand('azureFunctions.viewDeploymentLogs', unwrapTreeNodeCommandCallback(viewDeploymentLogs));
registerCommandWithTreeNodeUnwrapping('azureFunctions.viewProperties', viewProperties);
registerCommandWithTreeNodeUnwrapping('azureFunctions.showOutputChannel', () => { ext.outputChannel.show(); });
}
2 changes: 1 addition & 1 deletion src/commands/renameAppSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AppSettingTreeItem } from '@microsoft/vscode-azext-azureappservice';
import { AppSettingTreeItem } from '@microsoft/vscode-azext-azureappsettings';
import { IActionContext } from '@microsoft/vscode-azext-utils';
import { functionFilter } from '../constants';
import { ext } from '../extensionVariables';
Expand Down
Loading