@@ -137,15 +137,15 @@ private void ValidateOSPlatform(OSPlatform os)
137137 {
138138 if ( ! SupportedOperatingSystems . Any ( s => s . Equals ( os . ToString ( ) , StringComparison . OrdinalIgnoreCase ) ) )
139139 {
140- throw new PlatformNotSupportedException ( $ "OS { os . ToString ( ) } is not supported for language { Language } ") ;
140+ throw new PlatformNotSupportedException ( $ "OS { os } is not supported for language { Language } ") ;
141141 }
142142 }
143143
144144 private void ValidateArchitecture ( Architecture architecture )
145145 {
146146 if ( ! SupportedArchitectures . Any ( s => s . Equals ( architecture . ToString ( ) , StringComparison . OrdinalIgnoreCase ) ) )
147147 {
148- throw new PlatformNotSupportedException ( $ "Architecture { architecture . ToString ( ) } is not supported for language { Language } ") ;
148+ throw new PlatformNotSupportedException ( $ "Architecture { architecture } is not supported for language { Language } ") ;
149149 }
150150 }
151151
@@ -192,9 +192,20 @@ internal void FormatWorkerPathIfNeeded(ISystemRuntimeInformation systemRuntimeIn
192192
193193 OSPlatform os = systemRuntimeInformation . GetOSPlatform ( ) ;
194194 Architecture architecture = systemRuntimeInformation . GetOSArchitecture ( ) ;
195+
195196 string workerRuntime = environment . GetEnvironmentVariable ( RpcWorkerConstants . FunctionWorkerRuntimeSettingName ) ;
196- string version = environment . GetEnvironmentVariable ( RpcWorkerConstants . FunctionWorkerRuntimeVersionSettingName ) ;
197- logger . LogDebug ( $ "EnvironmentVariable { RpcWorkerConstants . FunctionWorkerRuntimeVersionSettingName } : { version } ") ;
197+
198+ string workerRuntimeVersionSettingName = RpcWorkerConstants . FunctionWorkerRuntimeVersionSettingName ;
199+
200+ // For LogicApps and the powershell worker config, we special case a separate environment variable.
201+ if ( environment . IsLogicApp ( ) && string . Equals (
202+ Language , RpcWorkerConstants . PowerShellLanguageWorkerName , StringComparison . Ordinal ) )
203+ {
204+ workerRuntimeVersionSettingName = RpcWorkerConstants . LogicAppsPowerShellVersionSettingName ;
205+ }
206+
207+ string version = environment . GetEnvironmentVariable ( workerRuntimeVersionSettingName ) ;
208+ logger . LogDebug ( $ "EnvironmentVariable { workerRuntimeVersionSettingName } : { version } ") ;
198209
199210 // Only over-write DefaultRuntimeVersion if workerRuntime matches language for the worker config
200211 if ( ! string . IsNullOrEmpty ( workerRuntime ) && workerRuntime . Equals ( Language , StringComparison . OrdinalIgnoreCase ) && ! string . IsNullOrEmpty ( version ) )
0 commit comments