Deploy to Service Fabric fails when upgrading

I’ve been testing out the new step for deploying a Service Fabric app (in version 3.13.3) and it works great the first time I deploy. But when I try to deploy a second time it fails with this error:

Exception calling “Invoke” with “0” argument(s): “A parameter cannot be found that matches parameter name ‘ApplicationParametersFilePath’.”
At D:\Files\Octopus\Work\20170516215813-9\staging\Octopus.AzureServiceFabricContext.ps1:227 char:1

I did some digging a bit deeper into it, and it looks like the problem might be in the DeployToServiceFabric.ps1 powershell script. The call to Publish-UpgradedServiceFabricApplication is being passed an argument -ApplicationParametersFilePath, but this script is expecting an argument called ApplicationParameterFilePath (no “s” after “Parameter”).

Hi Jeremy,

Thanks for getting in touch.

Yes, unfortunately we had a bug in our Service Fabric scripts regarding upgrades. This issue has been fixed in the latest version of Octopus, so if you are able to upgrade to the latest version, this should fix it for you.

If you are not able to upgrade at the current time, the only workaround is to specify your own deploy script in your package. That way you can overwrite the Calamari script that has this argument bug. Please see the Customizing the deployment process section of our documentation for details. The latest version of that script in Calamari has the bug fixed, so you can literally just copy that script into your package as per the instructions.

Once you have upgrades working correctly, you’ll need to follow the version automation guide to make sure your package versioning is ready for dealing with Service Fabric upgrade scenarios (because it’s pretty touchy when it comes to versioning) :slight_smile:

Sorry for the inconvenience.

Let me know how you go.

Cheers
Mark

Awesome, thanks for your reply. I’ve tried out the latest version of Octopus and upgrading now works!

I’m just testing things out currently and not running this in production, so upgrading Octopus was not a problem.