@@ -7,7 +7,8 @@ import { callWithTelemetryAndErrorHandling, type IActionContext } from '@microso
77import * as process from 'process' ;
88import { ShellExecution , Task , TaskScope , workspace , type CancellationToken , type ShellExecutionOptions , type TaskDefinition , type TaskProvider , type WorkspaceFolder } from 'vscode' ;
99import { tryGetFunctionProjectRoot } from '../commands/createNewProject/verifyIsProject' ;
10- import { ProjectLanguage , buildNativeDeps , extInstallCommand , func , hostStartCommand , packCommand , projectLanguageSetting } from '../constants' ;
10+ import { ConnectionKey , ProjectLanguage , buildNativeDeps , extInstallCommand , func , hostStartCommand , packCommand , projectLanguageSetting } from '../constants' ;
11+ import { getLocalSettingsConnectionString } from '../funcConfig/local.settings' ;
1112import { getFuncCliPath } from '../funcCoreTools/getFuncCliPath' ;
1213import { venvUtils } from '../utils/venvUtils' ;
1314import { getFuncWatchProblemMatcher , getWorkspaceSetting } from '../vsCodeConfig/settings' ;
@@ -120,6 +121,13 @@ export class FuncTaskProvider implements TaskProvider {
120121 options . cwd = projectRoot ;
121122 }
122123
124+ const [ azureWebJobsStorage , isEmulator ] = await getLocalSettingsConnectionString ( context , ConnectionKey . Storage , folder . uri . fsPath ) ;
125+ if ( azureWebJobsStorage && isEmulator ) {
126+ options . env = {
127+ "AzureWebJobsStorage" : azureWebJobsStorage
128+ }
129+ }
130+
123131 definition = definition || { type : func , command } ;
124132 return new Task ( definition , folder , command , func , new ShellExecution ( commandLine , options ) , problemMatcher ) ;
125133 }
0 commit comments