Skip to content

Commit

Permalink
Remove EnableWorkerIndexing feature flag (#4243)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejizba authored Aug 22, 2024
1 parent 7666fec commit 3355b05
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { FuncVersion } from '../../../FuncVersion';
import { gitignoreFileName, hostFileName, localSettingsFileName, workerRuntimeKey } from '../../../constants';
import { type IHostJsonV1, type IHostJsonV2 } from '../../../funcConfig/host';
import { type ILocalSettingsJson } from '../../../funcConfig/local.settings';
import { TemplateSchemaVersion } from '../../../templates/TemplateProviderBase';
import { bundleFeedUtils } from '../../../utils/bundleFeedUtils';
import { confirmOverwriteFile } from "../../../utils/fs";
import { nonNullProp } from '../../../utils/nonNull';
Expand Down Expand Up @@ -46,12 +45,6 @@ export class ScriptProjectCreateStep extends ProjectCreateStepBase {
this.localSettingsJson.Values![workerRuntimeKey] = functionsWorkerRuntime;
}

// feature flag needs to be enabled to use multiple entry points
if (isNodeV4Plus(context) || context.templateSchemaVersion === TemplateSchemaVersion.v2) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.localSettingsJson.Values!["AzureWebJobsFeatureFlags"] = "EnableWorkerIndexing";
}

await AzExtFsExtra.writeJSON(localSettingsJsonPath, this.localSettingsJson);
}

Expand Down
27 changes: 1 addition & 26 deletions src/commands/deploy/verifyAppSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import { type IActionContext } from '@microsoft/vscode-azext-utils';
import * as retry from 'p-retry';
import type * as vscode from 'vscode';
import { FuncVersion, tryParseFuncVersion } from '../../FuncVersion';
import { ConnectionKey, DurableBackend, azureWebJobsFeatureFlags, extensionVersionKey, runFromPackageKey, workerRuntimeKey, type ConnectionKeyValues, type DurableBackendValues, type ProjectLanguage } from '../../constants';
import { ConnectionKey, DurableBackend, extensionVersionKey, runFromPackageKey, workerRuntimeKey, type ConnectionKeyValues, type DurableBackendValues, type ProjectLanguage } from '../../constants';
import { ext } from '../../extensionVariables';
import { localize } from '../../localize';
import { type SlotTreeItem } from '../../tree/SlotTreeItem';
import { isNodeV4Plus, isPythonV2Plus } from '../../utils/programmingModelUtils';
import { isKnownWorkerRuntime, promptToUpdateDotnetRuntime, tryGetFunctionsWorkerRuntimeForProject } from '../../vsCodeConfig/settings';
import { type ISetConnectionSettingContext } from '../appSettings/connectionSettings/ISetConnectionSettingContext';

Expand Down Expand Up @@ -49,11 +48,6 @@ export async function verifyAppSettings(options: {
updateAppSettings ||= verifyRunFromPackage(context, node.site, appSettings.properties);
}

// feature flag is necessary for the new programming model
if (isNodeV4Plus(options) || isPythonV2Plus(options.language, options.languageModel)) {
updateAppSettings ||= verifyFeatureFlagSetting(context, node.site, appSettings.properties);
}

const updatedRemoteConnection: boolean = await verifyAndUpdateAppConnectionStrings(context, durableStorageType, appSettings.properties);
updateAppSettings ||= updatedRemoteConnection;

Expand Down Expand Up @@ -192,25 +186,6 @@ function verifyLinuxRemoteBuildSettings(context: IActionContext, remotePropertie
return hasChanged;
}

function verifyFeatureFlagSetting(context: IActionContext, site: ParsedSite, remoteProperties: { [propertyName: string]: string }): boolean {
const featureFlagString = remoteProperties[azureWebJobsFeatureFlags] || '';

// Feature flags are comma-delimited lists of beta features
// https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#azurewebjobsfeatureflags
const featureFlagArray = !featureFlagString ? [] : featureFlagString.split(',');
const enableWorkerIndexingValue = 'EnableWorkerIndexing';
const shouldAddSetting: boolean = !featureFlagArray.includes(enableWorkerIndexingValue);

if (shouldAddSetting) {
featureFlagArray.push(enableWorkerIndexingValue);
ext.outputChannel.appendLog(localize('addedFeatureFlag', 'Added feature flag "{0}" because it is required for the new programming model', enableWorkerIndexingValue), { resourceName: site.fullName });
remoteProperties[azureWebJobsFeatureFlags] = featureFlagArray.join(',');
}

context.telemetry.properties.addedFeatureFlagSetting = String(shouldAddSetting);
return shouldAddSetting;
}

// App settings are not always propagated before the deployment leading to an inconsistent behavior so verify that
async function verifyAppSettingsPropagated(context: IActionContext, client: SiteClient, expectedAppSettings: StringDictionary): Promise<void> {
const expectedProperties = expectedAppSettings.properties || {};
Expand Down
1 change: 0 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ export const extensionVersionKey: string = 'FUNCTIONS_EXTENSION_VERSION';
export const runFromPackageKey: string = 'WEBSITE_RUN_FROM_PACKAGE';
export const contentConnectionStringKey: string = 'WEBSITE_CONTENTAZUREFILECONNECTIONSTRING';
export const contentShareKey: string = 'WEBSITE_CONTENTSHARE';
export const azureWebJobsFeatureFlags: string = 'AzureWebJobsFeatureFlags';

/**
* The "current" Node.js model is 3 (and assumed, if the number is omitted).
Expand Down

0 comments on commit 3355b05

Please sign in to comment.