Search code examples
azureazure-service-fabric

Unable to deploy to Azure Service Fabric party cluster from Visual Studio 2017


I'm trying to publish a solution to a service fabric cluster, but something's going wrong. I've got access to a party cluster, downloaded the cert and installed. Connecting to Service Fabric Explorer works fine. Connecting to the cluster using Powershell seems to work. But the "Publish Service Fabric Application" dialog in Visual Studio 2017 does not accept the Connection Endpoint and shows a red icon next to the textbox. If I try to publish the solution anyway I get the following output in the console:

WARNING: Failed to contact Naming Service. Attempting to contact Failover Manager Service...

4>WARNING: Failed to contact Failover Manager Service, Attempting to contact FMM...

4>Connect-ServiceFabricCluster : Could not ping any of the provided Service Fabric gateway endpoints.

4>At C:\Users\jnsst\source\repos\Voting\Voting\Scripts\Deploy-FabricApplication.ps1:185 char:16

4>+ ...      [void](Connect-ServiceFabricCluster @ClusterConnectionParameters ...

4>+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

4>    + CategoryInfo          : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricTransientException

4>    + FullyQualifiedErrorId : TestClusterConnectionerror.Id,Microsoft.ServiceFabric.Powershell.ConnectCluster

4> 

4>WARNING: Unable to Verify connection to Service Fabric cluster.

4>Test-ServiceFabricClusterConnection : Cluster connection instance is null

I've followed all the instructions on learn.microsoft.com, but I'm obviously doing something wrong. Probably some silly small mistake.

I'm running Visual Studio 2017 Community on Windows 10.

Maybe I need to tell Visual Studio where the certs are stored?

Do you have any ideas?


Solution

    • install the certificate in your personal store, make sure it has the private key
    • make sure your publish profile (cloud.xml) looks similar to this:

    <ClusterConnectionParameters ConnectionEndpoint="mycluster.westus.cloudapp.azure.com:19000" X509Credential="true" ServerCertThumbprint="0123456789012345678901234567890123456789" FindType="FindByThumbprint" FindValue="9876543210987654321098765432109876543210" StoreLocation="CurrentUser" StoreName="My" />