Issues icon indicating copy to clipboard operation
Issues copied to clipboard

Unable to Deploy to Azure Web App (Web Deploy) if trailing slash included in Physical Path

Open Clare-Octopus opened this issue 1 month ago • 0 comments

Severity

Blocking customers from deploying to Azure Web Apps if they need a trailing slach in their physical path

Version

2025.3.14485, 2026.1.1857

Latest Version

I could reproduce the problem in the latest build

What happened?

If you have a trailing slash in your Deployment Physical path section, Octopus will see that as an escape character and therefore discount any end quotes included in the command. Octopus will then see the full command as part of one argument and thinks the others are missing.

We have tested with a Deploy an Azure Web App (Web Deploy) step, but this may also happen if using a Deploy an Azure App Service step with the physical path using a trailing slash in a configuration file.

Physical Path with trailing slash:

Image

Physical Path without trailing slash:

Image

The error code you will see is:

  Required option 'destUserName' is missing. 
  Required option 'destPassword' is missing. 
  Required option 'destUri' is missing. 
  Required option 'destSite' is missing. 
  Required option 'encryptionKey' is missing. 

Reproduction

  1. Create a basic Azure Web App, not sure if it happens with Linux, as this was tested with a Windows WebApp.
  2. Add the Web app as a Deployment Target in Octopus.
  3. Create a project with a Deploy an Azure Web App (Web Deploy) step and use the deployment target we created in step 2.
  4. Set the physical path to something with a trailing slash in it ie site\wwwroot\foo\.
  5. Create a release and deploy it, see the error.
  6. Remove the trailing slash from the Physical path ie site\wwwroot\foo and save the step changes.
  7. Create a new release and deploy, see the deployment be successful.

Error and Stacktrace

Calamari.AzureWebApp.NetCoreShim 2025.3.338 
Copyright (C) 2025 Calamari.AzureWebApp.NetCoreShim 
ERROR(S): 
  Required option 'destUserName' is missing. 
  Required option 'destPassword' is missing. 
  Required option 'destUri' is missing. 
  Required option 'destSite' is missing. 
  Required option 'encryptionKey' is missing. 
  --sourcePath         Required. 
  --destPath           Required. 
  --destUserName       Required. 
  --destPassword       Required. 
  --destUri            Required. 
  --destSite           Required. 
  --useChecksum        (Default: false) 
  --doNotDelete        (Default: false) 
  --useAppOffline      (Default: false) 
  --preserveAppData    (Default: false) 
  --preservePaths       
  --encryptionKey      Required. 
  --help               Display this help screen. 
  --version            Display version information. 
System.Exception 
   at Calamari.AzureWebApp.NetCoreWebDeploymentExecutor.ExecuteDeployment(RunningDeployment deployment, AzureTargetSite targetSite, IVariables variables, WebDeployPublishSettings publishSettings) in C:\BuildAgent\work\62728692c7c35200\source\Calamari.AzureWebApp\NetCoreWebDeploymentExecutor.cs:line 83 
   at Calamari.AzureWebApp.NetCoreWebDeploymentExecutor.ExecuteDeployment(RunningDeployment deployment, AzureTargetSite targetSite, IVariables variables, WebDeployPublishSettings publishSettings) in C:\BuildAgent\work\62728692c7c35200\source\Calamari.AzureWebApp\NetCoreWebDeploymentExecutor.cs:line 0 
   at Calamari.AzureWebApp.AzureWebAppBehaviour.Execute(RunningDeployment deployment) in C:\BuildAgent\work\62728692c7c35200\source\Calamari.AzureWebApp\AzureWebAppBehaviour.cs:line 68 
   at Calamari.Common.Plumbing.Pipeline.PipelineCommand.ExecuteBehaviour(RunningDeployment context, IBehaviour behaviour) in C:\BuildAgent\work\62728692c7c35200\source\Calamari.Common\Plumbing\Pipeline\PipelineCommand.cs:line 164 
   at Calamari.Common.Plumbing.Pipeline.PipelineCommand.Execute(ILifetimeScope lifetimeScope, IVariables variables) in C:\BuildAgent\work\62728692c7c35200\source\Calamari.Common\Plumbing\Pipeline\PipelineCommand.cs:line 60 
   at Calamari.Common.Plumbing.Pipeline.PipelineCommand.Execute(ILifetimeScope lifetimeScope, IVariables variables) in C:\BuildAgent\work\62728692c7c35200\source\Calamari.Common\Plumbing\Pipeline\PipelineCommand.cs:line 84 
   at Calamari.Common.CalamariFlavourProgramAsync.Run(String[] args) in C:\BuildAgent\work\62728692c7c35200\source\Calamari.Common\CalamariFlavourProgramAsync.cs:line 145 
The remote script failed with exit code 100

More Information

Initial customer ticket (internal) - https://octopuscd.zendesk.com/agent/tickets/179396 RnD (internal) - https://octopusdeploy.slack.com/archives/CNHBHV2BX/p1764342618555719

Workaround

Remove the trailing slash in the physical path, save the step changes and create a new release.

Clare-Octopus avatar Dec 08 '25 10:12 Clare-Octopus