Fabric Service Cluster Publishing Fails Due to Test-ServiceFabricClusterConnection

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?

+7
source share
3 answers

Check if the certificate is installed correctly on your computer. I ran into a similar problem and installed a certificate and it worked. Also check if the repository is installed correctly on

StoreLocation = "LocalMachine"

, StoreLocation = "CurrentUser"

0

$clusterConnection = Connect-ServiceFabricCluster -ConnectionEndpoint $ClusterConnectionParameters.ConnectionEndpoint -ErrorAction Stop

Connect-ServiceFabricCluster -ConnectionEndpoint $ClusterConnectionParameters.ConnectionEndpoint -ErrorAction Stop

0

$global:clusterConnection = $clusterConnection Connect-ServiceFabricCluster Deploy-FabricApplication.ps1 .

Connect-ServiceFabricCluster $clusterConnection Powershell, . .

0

Source: https://habr.com/ru/post/1655390/


All Articles