@@ -137,15 +137,15 @@ private void ValidateOSPlatform(OSPlatform os)
137
137
{
138
138
if ( ! SupportedOperatingSystems . Any ( s => s . Equals ( os . ToString ( ) , StringComparison . OrdinalIgnoreCase ) ) )
139
139
{
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 } ") ;
141
141
}
142
142
}
143
143
144
144
private void ValidateArchitecture ( Architecture architecture )
145
145
{
146
146
if ( ! SupportedArchitectures . Any ( s => s . Equals ( architecture . ToString ( ) , StringComparison . OrdinalIgnoreCase ) ) )
147
147
{
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 } ") ;
149
149
}
150
150
}
151
151
@@ -192,9 +192,20 @@ internal void FormatWorkerPathIfNeeded(ISystemRuntimeInformation systemRuntimeIn
192
192
193
193
OSPlatform os = systemRuntimeInformation . GetOSPlatform ( ) ;
194
194
Architecture architecture = systemRuntimeInformation . GetOSArchitecture ( ) ;
195
+
195
196
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 } ") ;
198
209
199
210
// Only over-write DefaultRuntimeVersion if workerRuntime matches language for the worker config
200
211
if ( ! string . IsNullOrEmpty ( workerRuntime ) && workerRuntime . Equals ( Language , StringComparison . OrdinalIgnoreCase ) && ! string . IsNullOrEmpty ( version ) )
0 commit comments