diff --git a/extensions/notebook/src/jupyter/serverInstance.ts b/extensions/notebook/src/jupyter/serverInstance.ts index 00309257ee..b58db7fef1 100644 --- a/extensions/notebook/src/jupyter/serverInstance.ts +++ b/extensions/notebook/src/jupyter/serverInstance.ts @@ -377,8 +377,13 @@ export class PerNotebookServerInstance implements IServerInstance { return childProcess; } - private getEnvWithConfigPaths(env: {}): any { + private getEnvWithConfigPaths(env: { [key: string]: string }): any { + // Take the variables that starts with 'AZDATA_NB_VAR_' from process.env object so that we can pass information to notebooks let newEnv: { [key: string]: string } = Object.assign({}, env); + Object.keys(process.env).filter(key => key.startsWith('AZDATA_NB_VAR_')).forEach(key => { + newEnv[key] = process.env[key]; + }); + newEnv['JUPYTER_CONFIG_DIR'] = this.instanceConfigRoot; newEnv['JUPYTER_PATH'] = this.instanceDataRoot; return newEnv;