Azure deployment error "Failed to deploy package with -1"

When running any Publish-Orchestrator.ps1 PowerShell gives an error stating "Microsoft.PowerShell.Commands.WriteErrorException: Failed to deploy package Orchestrator.Web.zip with -1"

It is difficult to find the root cause for the below error as it does not display the inner error for enabling the inner exception enable the below setting.

  • Microsoft.PowerShell.Commands.WriteErrorException: Failed to deploy package Orchestrator.Web.zip with -1


Resolution:

Next to the line where it is failing ideally it will be at the Deploy-Package() function of the PowerShell script, commence the script below for generating stdout.txt and stderr.txt, which contains a standard error and provides more details about the exception.

Script to add:

-RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt
Example:
image.png

The above files (stderr.txt and stdout.txt) will be generated in the same location from where the script is run.