Powershell script problem when swapping azure web app slots

Hi, We have been use Octopus deploy for a while. We use the following script to do the swapping of slots:

$ParametersObject = @{targetSlot = “production”}

Invoke-AzureRmResourceAction -ResourceGroupName #{web-app-resource-group} -ResourceType Microsoft.Web/sites/slots -ResourceName #{web-app-target-ui-soar}/Staging -Action slotsswap -Parameters $ParametersObject -ApiVersion 2015-07-01 -Force

This morning, we suddenly run into a problems in this step. It is complaining the following. Any insight would be highly appreciated.

Octopus Server version: 3.3.8+Branch.master.Sha.ce74fb45b4197c055b4a7cb8799ae9d048b1dce2

11:33:47

Verbose
Using account ID ‘Octopus Deployment V4’

11:33:48

Verbose
Octopus Deploy: Calamari.Azure version 3.3.8+Branch.master.Sha.2d50790e95504aafbed8cc4a0b80c586fa074f18

11:34:00

Error
At D:\Octopus\Work\20160822163347-1782\Bootstrap.Octopus.AzureContext.ps1:1476 char:9

11:34:00

Error

  •     If (Test-Path #{Octopus.Tentacle.Agent.ApplicationDirectoryPath}\current ...
    

11:34:00

Error

  •     ~~
    

11:34:00

Error
Missing closing ‘)’ after expression in ‘If’ statement.

11:34:00

Error
At D:\Octopus\Work\20160822163347-1782\Bootstrap.Octopus.AzureContext.ps1:1477 char:13

11:34:00

Error

  •         New-OctopusArtifact -Path #{Octopus.Tentacle.Agent.ApplicationDirect ...
    

11:34:00

Error

  •         ~~~~~~~~~~~~~~~~~~~
    

11:34:00

Error
Missing closing ‘)’ after expression in ‘If’ statement.

11:34:00

Error
At D:\Octopus\Work\20160822163347-1782\Bootstrap.Octopus.AzureContext.ps1:1482 char:1

11:34:00

Error

  • }

11:34:00

Error

  • ~

11:34:00

Error
Unexpected token ‘}’ in expression or statement.

11:34:00

Error
At D:\Octopus\Work\20160822163347-1782\Bootstrap.Octopus.AzureContext.ps1:1484 char:1

11:34:00

Error

  • } | Import-Module

11:34:00

Error

  • ~

11:34:00

Error
Unexpected token ‘}’ in expression or statement.

We found the problem. We put in a powershell script module. The module has some syntax errors. The confusing part is that we didn’t know it was from our script module. Would be great if the tool can give more specific feedback.

Thanks anyway.

Hi,

Thanks for getting in touch! I’m glad to hear you were able to sort it out.

You have a good point there actually. I’ve created this github issue to improve logging around those kind of errors: https://github.com/OctopusDeploy/Issues/issues/2662

Thanks!
Dalmiro

Notice:

This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.