I am using the Deploy-FabricApplication.ps1 script that is created when creating the Service Fabric project to deploy my application.
When deploying to a Service Fabric cluster, I can deploy locally if I first connected to the local cluster using Connect-ServiceFabricCluster. However, my build server does not start the local cluster instance, so I cannot connect to the local instance first. When I connect to Connect-ServiceFabricCluster @ClusterConnectionParameters, I get the data back to the connection that was successful. When it goes to publish and runs the Test-ServiceFabricClusterConnection command, I get the following error.
WARNING: Unable to Verify connection to Service Fabric cluster.
Test-ServiceFabricClusterConnection : Cluster connection instance is null
At C:\ProgramFiles\MicrosoftSDKs\ServiceFabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:129 char:16
+ [void](Test-ServiceFabricClusterConnection)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [Test-ServiceFabricClusterConnection], NullReferenceException
+ FullyQualifiedErrorId : GetClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.TestClusterConnection
I tried to remove Test-ServiceFabricClusterConnection from the Publish-NewServiceFabricApplication.ps1 module and I get a different set of errors. No matter what I tried up to this point, if I first connected to the cluster, it works, but not if I connect through the powershell script.
Update! solvable Solved this using a point source: How to deploy a service application from the VSTS pipeline?
source
share