@@ -12,7 +12,7 @@ import type * as vscode from 'vscode';
12
12
import { CodeAction , deploySubpathSetting , DurableBackend , hostFileName , ProjectLanguage , remoteBuildSetting , ScmType , stackUpgradeLearnMoreLink } from '../../constants' ;
13
13
import { ext } from '../../extensionVariables' ;
14
14
import { addLocalFuncTelemetry } from '../../funcCoreTools/getLocalFuncCoreToolsVersion' ;
15
- import { funcToolsInstalled , validateFuncCoreToolsInstalled } from '../../funcCoreTools/validateFuncCoreToolsInstalled' ;
15
+ import { validateFuncCoreToolsInstalled } from '../../funcCoreTools/validateFuncCoreToolsInstalled' ;
16
16
import { localize } from '../../localize' ;
17
17
import { ResolvedFunctionAppResource } from '../../tree/ResolvedFunctionAppResource' ;
18
18
import { type SlotTreeItem } from '../../tree/SlotTreeItem' ;
@@ -220,14 +220,10 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
220
220
eolWarningMessage ? stackUpgradeLearnMoreLink : undefined ) ;
221
221
}
222
222
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
225
225
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 {
231
227
await runPreDeployTask ( context , context . effectiveDeployFsPath , siteConfig . scmType ) ;
232
228
233
229
if ( isZipDeploy ) {
@@ -253,13 +249,14 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
253
249
} ) ;
254
250
}
255
251
}
252
+
256
253
let deployedWithFuncCli = false ;
257
254
await node . runWithTemporaryDescription (
258
255
context ,
259
256
localize ( 'deploying' , 'Deploying...' ) ,
260
257
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 ) {
263
260
context . telemetry . properties . funcCoreToolsInstalled = 'true' ;
264
261
context . telemetry . properties . deployMethod = 'funccli' ;
265
262
const deployContext = Object . assign ( context , await createActivityContext ( ) , { site } ) as unknown as InnerDeployContext ;
0 commit comments