Closed pkothare closed 6 months ago
wondering why only ENABLE_HA
and HA_PORT
are included in the changes except other variables
wondering why only
ENABLE_HA
andHA_PORT
are included in the changes except other variables
@byran77, the problem is scoping. Lines 87-144: https://github.com/Azure/Azure-Data-Factory-Integration-Runtime-in-Windows-Container/blob/b4989a057d180912772b71f2b90c9e463db333db/SHIR/setup.ps1#L87-L144
are not scoped to any function, and thus $ENABLE_HA
and $HA_PORT
are undefined when the script execution reaches L90 and L92 subsequently. However, $Env:ENABLE_HA
and $Env:HA_PORT
may be available as a consequence of running the docker run ...
command.
This may been an error when it was initially developed, which is why I'm proposing the changes. It also potentially resolves #3.
wondering why only
ENABLE_HA
andHA_PORT
are included in the changes except other variables@byran77, the problem is scoping. Lines 87-144:
are not scoped to any function, and thus
$ENABLE_HA
and$HA_PORT
are undefined when the script execution reaches L90 and L92 subsequently. However,$Env:ENABLE_HA
and$Env:HA_PORT
may be available as a consequence of running thedocker run ...
command. This may been an error when it was initially developed, which is why I'm proposing the changes. It also potentially resolves #3.
make sense, thanks @pkothare
When running:
as defined in the README, the entry point of the container is
This implies
ENABLE_HA
andHA_PORT
are considered environment variables when the main section ofsetup.ps1
runs. This change references the environment variables$Env:ENABLE_HA
and$Env:HA_PORT
in the main section instead ofsetup.ps1
instead of$ENABLE_HA
and$HA_PORT
since the locally scoped variables are undefined initially.