Skip to content

Commit 602f32a

Browse files
authored
Deploy with CLI for custom runtimes on flex (#4650)
* Check for custom for verifying app settings
1 parent 1d8ef94 commit 602f32a

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

.github/copilot-instructions.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/commands/deploy/deploy.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type * as vscode from 'vscode';
1212
import { CodeAction, deploySubpathSetting, DurableBackend, hostFileName, ProjectLanguage, remoteBuildSetting, ScmType, stackUpgradeLearnMoreLink } from '../../constants';
1313
import { ext } from '../../extensionVariables';
1414
import { addLocalFuncTelemetry } from '../../funcCoreTools/getLocalFuncCoreToolsVersion';
15-
import { funcToolsInstalled, validateFuncCoreToolsInstalled } from '../../funcCoreTools/validateFuncCoreToolsInstalled';
15+
import { validateFuncCoreToolsInstalled } from '../../funcCoreTools/validateFuncCoreToolsInstalled';
1616
import { localize } from '../../localize';
1717
import { ResolvedFunctionAppResource } from '../../tree/ResolvedFunctionAppResource';
1818
import { type SlotTreeItem } from '../../tree/SlotTreeItem';
@@ -220,14 +220,10 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
220220
eolWarningMessage ? stackUpgradeLearnMoreLink : undefined);
221221
}
222222

223-
let isFuncToolsInstalled: boolean = await funcToolsInstalled(context, context.workspaceFolder.uri.fsPath);
224-
if (language === ProjectLanguage.Custom && !isFuncToolsInstalled) {
223+
if (language === ProjectLanguage.Custom && isFlexConsumption) {
224+
// don't run predeploy tasks and verify settings for a deployment with the CLI
225225
await validateFuncCoreToolsInstalled(context, localize('validateFuncCoreToolsCustom', 'The Functions Core Tools are required to deploy to a custom runtime function app.'));
226-
isFuncToolsInstalled = true;
227-
}
228-
229-
230-
if (!isFuncToolsInstalled) {
226+
} else {
231227
await runPreDeployTask(context, context.effectiveDeployFsPath, siteConfig.scmType);
232228

233229
if (isZipDeploy) {
@@ -253,13 +249,14 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
253249
});
254250
}
255251
}
252+
256253
let deployedWithFuncCli = false;
257254
await node.runWithTemporaryDescription(
258255
context,
259256
localize('deploying', 'Deploying...'),
260257
async () => {
261-
// prioritize func cli deployment if installed
262-
if (isFuncToolsInstalled) {
258+
// deploy with func cli for custom runtimes on flex consumption due to additional requirements
259+
if (language === ProjectLanguage.Custom && isFlexConsumption) {
263260
context.telemetry.properties.funcCoreToolsInstalled = 'true';
264261
context.telemetry.properties.deployMethod = 'funccli';
265262
const deployContext = Object.assign(context, await createActivityContext(), { site }) as unknown as InnerDeployContext;

0 commit comments

Comments
 (0)