Error running Deploy.ps1 when deploying and Azure web app

I am trying to deploy an Azure web app and my package includes Deploy.ps1.
Octopus fails to run Deploy.ps1 for me and terminates the deploy operation with an error, see attachment.

Hi Ali,

Thanks for getting in touch! This particular script looks like it’s using the Path.Combine(string, string, string) method which was introduced in .NET 4.0. The problem in your case is that the Octopus Server only has PowerShell 2.0.

I’ve raised a GitHub Issue to fix this script and use a more compatible method of combining the path: https://github.com/OctopusDeploy/Issues/issues/2823

I can’t make any guarantees as to when this would be completed.

In the meantime, you can work around this problem by upgrading to PowerShell v3.0 (or newer).

Thanks for reporting this issue. :slight_smile:

Hope that helps!
Mike