Deploy on fabric cluster

i am dereploying to a service fabric cluster in azure, i can connect from the server to the target and all certifications are correct. when i deploy i get the following error

Invoke-Expression : Cannot validate argument on parameter
July 14th 2017 15:15:49Error
’PublishProfileFile’. The “Test-Path $_ -PathType Leaf” validation script for
July 14th 2017 15:15:49Error
the argument with value “ApplicationManifest.xml” did not return a result of
July 14th 2017 15:15:49Error
True. Determine why the validation script failed, and then try the command
July 14th 2017 15:15:49Error
again.
July 14th 2017 15:15:49Error
At C:\Octopus\Work\20170714221537-62\staging\Octopus.AzureServiceFabricContext.
July 14th 2017 15:15:49Error
ps1:227 char:1

can you help

Hi,

Thanks for getting in touch.

Can you confirm if you’ve previously deployed to this SF cluster using Octopus before? Has this only just started failing, or is this your first deployment to SF using Octopus?

The message seems to suggest there’s a problem addressing your ApplicationManifest.xml file (or some reference within that file). Could you confirm if your SF package is structured correctly for use with Octopus (specifically your ApplicationManifest.xml file, as per the example in this documentation.

Can you currently redeploy to SF manually with Visual Studio? ie. Is this problem only occurring if you’re using Octopus? It may be worth testing that you can redeploy with Visual Studio to see if the same error occurs there. If so, that may help track down if there’s a problem in your package.

If that doesn’t help, you can debug the PowerShell script by overriding the default script we bundle in Calamari for Service Fabric steps. See the Customizing the deployment process section of the SF documentation. This documentation will point you towards the bundled script that you can override (and if you search this script, you will see “Test-Path $_ -PathType Leaf” which appears in your error message). This may help you track down exactly where/why the script is failing in your case.

Hope this helps.

Cheers
Mark

Hi Mark,
This is the first tie we are deploying to SF via octopus, we were doing deployments via Visual Studio before. The error we are getting is mainly because the files are not being copied from repo to work directory. I can hard code the path to the profile file and I can get passed this error. But that is not the best way.
Do certain variables need to be created /added to reference files ?
Danny

Hi Danny,

For SF packages to work in Octopus, they need to be structured a certain way (because when deploying straight from Visual Studio, the profile and parameters files are referenced from the source code, but when deploying through Octopus, they must be included in the NuGet/Zip package so they are available at deployment time).

We have a useful guide here that you can read through to make sure your package includes all the files/folders needed for SF deployments with Octopus. We highly recommend the Custom build targets section, but the documentation lists several methods that you can compare and contrast for your specific needs.

Once you have packaged your application, you can compare it to the “Final Package Structure” section of the above documentation before trying to deploy your package with Octopus. It should then contain all the files it needs for the deployment without you needing to hardcode paths to certain files etc.

Hope this helps. Let me know how you go.

Mark

Hi Mark,

this helped and i was able to deploy the application to SFC successfully. please close this ticket … also thank you

Danny