Powershell 7/Core in WebApp

Product: PowerShell Universal
Version: 1.5.13

I’ve used the Azure WebApp Github Action repo to install Universal in Azure and wanted to know how to get Powershell Core/7 installed?

Any ideas or leads appreciated

You should be able to download the PS7 ZIP from GitHub and extract it to the web app.


Maybe update the download.ps1 file with something like:

Invoke-WebRequest "https://github.com/PowerShell/PowerShell/releases/download/v7.1.2/PowerShell-7.1.2-win-x64.zip" -OutFile ".\ps7.zip"
Expand-Archive -Path .\ps7.zip -DestinationPath .\ps7

The other thing you may need to do it is add that path to the $Env:PATH variable so Universal can find the PS7 executable automatically. You could also add the custom path via Environments in PSU.

Thanks Adam, I’ve done basically what you suggested already by uploading an extracted version of that zip to D:\Home as well as under D:\home\wwwroot\ps7.

I added both paths via Environments in PSU, created a new dashboard but when clicking start it attempts to start for quite a while before stopping.

I’ve added pwsh to the application settings, no luck when trying to call pwsh in PSU Environment

You mention setting the #ENV:Path variable, do i need to do that as described here

setting the webapp %PATH% environment variable in azure - Stack Overflow

Where are the logs stored in this environment so I can look for clues?

Bummer. Thought that would work.

Logs will depend on your Azure Web App settings but you should be able to view them in the log stream.

You shouldn’t have to set the $ENV:Path variable if you have put the full path to pwsh.exe. The other thing you could try to do is open the Azure Kudu Tools and attempt launch pwsh.exe from within the terminal there. That might give you an error message as to why it’s not starting properly.

Yeah it’s a bummer :frowning:

I have put it in the default path and can launch it from any folder manually using pwsh and then check the processes and see it momentarily. No joy using it within PU.

Tried the same with 32bit, get a dll

The other way to accomplish this is to use a Docker Web App. We have a Windows Server Core image that contains PS7. Docker web apps are kinda their own beast though.

1 Like