mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
pass environment variables to Notebooks from ADS (#6389)
* get the new environment variables for notebook * comments * Update serverInstance.ts address comments * be more specific when taking env variables
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user