Another way to fix this could be to make the PATH environment variable on the Windows sandbox point to either D:\Program Files (x86)\dotnet or D:\Program Files\dotnet, according to the app platform bitness setting. When this is done, the path resolution code introduced by https://github.com/Azure/azure-functions-host/pull/5011 can be removed and we will simply rely on the OS for all platforms.
This is a potentially breaking change: it may affect not only dotnet-based workers, but any function that happens to invoke dotnet. Consider this carefully!
In order to fix https://github.com/Azure/azure-functions-powershell-worker/issues/232, the following PR temporarily makes the Functions host resolve the dotnet executable path to the one that matches the bitness of the host process: https://github.com/Azure/azure-functions-host/pull/5011.
Another way to fix this could be to make the PATH environment variable on the Windows sandbox point to either
D:\Program Files (x86)\dotnet
orD:\Program Files\dotnet
, according to the app platform bitness setting. When this is done, the path resolution code introduced by https://github.com/Azure/azure-functions-host/pull/5011 can be removed and we will simply rely on the OS for all platforms.This is a potentially breaking change: it may affect not only dotnet-based workers, but any function that happens to invoke dotnet. Consider this carefully!