4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
6
import { type Site , type SiteConfigResource , type StringDictionary } from '@azure/arm-appservice' ;
7
- import { getDeployFsPath , getDeployNode , deploy as innerDeploy , showDeployConfirmation , type IDeployContext , type IDeployPaths } from '@microsoft/vscode-azext-azureappservice' ;
7
+ import { getDeployFsPath , getDeployNode , deploy as innerDeploy , showDeployConfirmation , type IDeployContext , type IDeployPaths , type ParsedSite } from '@microsoft/vscode-azext-azureappservice' ;
8
8
import { DialogResponses , type ExecuteActivityContext , type IActionContext , type ISubscriptionActionContext } from '@microsoft/vscode-azext-utils' ;
9
9
import { type AzureSubscription } from '@microsoft/vscode-azureresources-api' ;
10
10
import type * as vscode from 'vscode' ;
@@ -83,6 +83,8 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
83
83
return await getOrCreateFunctionApp ( context )
84
84
} ) ;
85
85
86
+ const site = await node . resolved . getSite ( context ) ;
87
+
86
88
if ( node . contextValue . includes ( 'container' ) ) {
87
89
const learnMoreLink : string = 'https://aka.ms/deployContainerApps'
88
90
await context . ui . showWarningMessage ( localize ( 'containerFunctionAppError' , 'Deploy is not currently supported for containerized function apps within the Azure Functions extension. Please read here to learn how to deploy your project.' ) , { learnMoreLink } ) ;
@@ -98,19 +100,19 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
98
100
context . telemetry . properties . projectRuntime = version ;
99
101
context . telemetry . properties . languageModel = String ( languageModel ) ;
100
102
101
- if ( language === ProjectLanguage . Python && ! node . site . isLinux ) {
103
+ if ( language === ProjectLanguage . Python && ! site . isLinux ) {
102
104
context . errorHandling . suppressReportIssue = true ;
103
105
throw new Error ( localize ( 'pythonNotAvailableOnWindows' , 'Python projects are not supported on Windows Function Apps. Deploy to a Linux Function App instead.' ) ) ;
104
106
}
105
107
106
- void showCoreToolsWarning ( context , version , node . site . fullName ) ;
108
+ void showCoreToolsWarning ( context , version , site . fullName ) ;
107
109
108
- const client = await node . site . createClient ( actionContext ) ;
110
+ const client = await site . createClient ( actionContext ) ;
109
111
const siteConfig : SiteConfigResource = await client . getSiteConfig ( ) ;
110
112
const isConsumption : boolean = await client . getIsConsumption ( actionContext ) ;
111
113
let isZipDeploy : boolean = siteConfig . scmType !== ScmType . LocalGit && siteConfig . scmType !== ScmType . GitHub ;
112
- if ( ! isZipDeploy && node . site . isLinux && isConsumption ) {
113
- ext . outputChannel . appendLog ( localize ( 'linuxConsZipOnly' , 'WARNING: Using zip deploy because scm type "{0}" is not supported on Linux consumption' , siteConfig . scmType ) , { resourceName : node . site . fullName } ) ;
114
+ if ( ! isZipDeploy && site . isLinux && isConsumption ) {
115
+ ext . outputChannel . appendLog ( localize ( 'linuxConsZipOnly' , 'WARNING: Using zip deploy because scm type "{0}" is not supported on Linux consumption' , siteConfig . scmType ) , { resourceName : site . fullName } ) ;
114
116
isZipDeploy = true ;
115
117
context . deployMethod = 'zip' ;
116
118
}
@@ -121,10 +123,10 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
121
123
const doRemoteBuild : boolean | undefined = getWorkspaceSetting < boolean > ( remoteBuildSetting , deployPaths . effectiveDeployFsPath ) && ! isFlexConsumption ;
122
124
actionContext . telemetry . properties . scmDoBuildDuringDeployment = String ( doRemoteBuild ) ;
123
125
if ( doRemoteBuild ) {
124
- await validateRemoteBuild ( context , node . site , context . workspaceFolder , language ) ;
126
+ await validateRemoteBuild ( context , site , context . workspaceFolder , language ) ;
125
127
}
126
128
127
- if ( isZipDeploy && node . site . isLinux && isConsumption && ! doRemoteBuild ) {
129
+ if ( isZipDeploy && site . isLinux && isConsumption && ! doRemoteBuild ) {
128
130
context . deployMethod = 'storage' ;
129
131
} else if ( isFlexConsumption ) {
130
132
context . deployMethod = 'flexconsumption' ;
@@ -161,7 +163,7 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
161
163
} as unknown as ISubscriptionActionContext ;
162
164
163
165
const eolWarningMessage = await getEolWarningMessages ( subContext , {
164
- site : node . site . rawSite ,
166
+ site : site . rawSite ,
165
167
isLinux : client . isLinux ,
166
168
isFlex : isFlexConsumption ,
167
169
client
@@ -175,7 +177,7 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
175
177
deploymentWarningMessages . length > 0 ) {
176
178
// if there is a warning message, we want to show the deploy confirmation regardless of the setting
177
179
const deployCommandId = 'azureFunctions.deploy' ;
178
- await showDeployConfirmation ( context , node . site , deployCommandId , deploymentWarningMessages ,
180
+ await showDeployConfirmation ( context , site , deployCommandId , deploymentWarningMessages ,
179
181
eolWarningMessage ? stackUpgradeLearnMoreLink : undefined ) ;
180
182
}
181
183
@@ -185,8 +187,8 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
185
187
void validateGlobSettings ( context , context . effectiveDeployFsPath ) ;
186
188
}
187
189
188
- if ( language === ProjectLanguage . CSharp && ! node . site . isLinux || durableStorageType ) {
189
- await updateWorkerProcessTo64BitIfRequired ( context , siteConfig , node , language , durableStorageType ) ;
190
+ if ( language === ProjectLanguage . CSharp && ! site . isLinux || durableStorageType ) {
191
+ await updateWorkerProcessTo64BitIfRequired ( context , siteConfig , site , language , durableStorageType ) ;
190
192
}
191
193
192
194
// app settings shouldn't be checked with flex consumption plans
@@ -222,15 +224,15 @@ async function deploy(actionContext: IActionContext, arg1: vscode.Uri | string |
222
224
}
223
225
const deployContext = Object . assign ( context , await createActivityContext ( ) ) ;
224
226
deployContext . activityChildren = [ ] ;
225
- await innerDeploy ( node . site , deployFsPath , deployContext ) ;
227
+ await innerDeploy ( site , deployFsPath , deployContext ) ;
226
228
}
227
229
) ;
228
230
229
231
await notifyDeployComplete ( context , node , context . workspaceFolder , isFlexConsumption ) ;
230
232
}
231
233
232
- async function updateWorkerProcessTo64BitIfRequired ( context : IDeployContext , siteConfig : SiteConfigResource , node : SlotTreeItem , language : ProjectLanguage , durableStorageType : DurableBackendValues | undefined ) : Promise < void > {
233
- const client = await node . site . createClient ( context ) ;
234
+ async function updateWorkerProcessTo64BitIfRequired ( context : IDeployContext , siteConfig : SiteConfigResource , site : ParsedSite , language : ProjectLanguage , durableStorageType : DurableBackendValues | undefined ) : Promise < void > {
235
+ const client = await site . createClient ( context ) ;
234
236
const config : SiteConfigResource = {
235
237
use32BitWorkerProcess : false
236
238
} ;
0 commit comments