I configured the CI assembly for the Service Fabric application in Visual Studio Team Services according to this documentation: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration p>
But instead of having my CI assembly do the publishing, I only do the Build and Package tasks and include all the output related to the Service Fabric, such as the pkg folder, scripts, publishing profiles and application settings. That way, I can transfer it along with the new release pipeline (agent-based releases) to actually deploy my application for services.
In my release definition, I have one Azure Powershell task that uses an ARM endpoint (with the settings for the corresponding service managers).
When I deploy my application to an existing service cluster cluster, I use the default Deploy-FabricApplication cmdlet, which goes through the pkg folder, and the publishing profile configured to connect to the existing cluster.
Release failed with error message "Cluster connection instance is zero." And I donβt understand why?
While doing some debugging, I found that: The Deploy-FabricApplication cmdlet runs the Connect-ServiceFabricCluster cmdlet as accurately as possible, but as soon as the Publish-NewServiceFabricApplication cmdlet starts, the cluster connection will be lost.
I would expect this scenario to be possible using service cmdlets, but I cannot figure out how to keep the cluster connection open during deactivation.
UPDATE: the documentation link no longer refers to powershell Service Fabric scripts, so the precondition for this question is no longer documented. This article now discusses VSTS build and release tasks, which may be preferable to the powershell cmdlets I tried to use.