I've created a Service Fabric Application currently consisting of two Reliable Services and a Reliable Actor. For development, I created an SQL Server and database in Azure, and hardcoded the connection string into my application, which I was running on my local SF cluster. This worked fine, and I was able to run my application locally whilst manipulating the database in the cloud.
I now want to publish my service to the cloud, and run it all remotely (so that I can set up and test the Web API is exposes), and this is where the problems start.
Following Azure docs:
- Create a Service Fabric cluster in Azure using Azure Resource Manager
- Connect to a secure cluster
- Configure secure connections to a Service Fabric cluster from Visual Studio
- Service Fabric cluster security scenarios
- Publish an application to a remote cluster by using Visual Studio
- Add or remove certificates for a Service Fabric cluster in Azure
I have taken the following steps:
Used Powershell (with
ServiceFabricRPHelperscmdlets) to create a KeyVault resource group, and within that aKeyVault.Used
New-SelfSignedCertificatewith -DnsName set to api.mydomain.co.uk, which I have already purchased and created a CNAME record for api leading to mycluster.northeurope.cloudapp.azure.com:19000 (though of course it doesn't exist at this stage of the process), followed byExport-PfxCertificateto create the.pfxfile. The.pfxwas then imported tocert:\CurrentUser\TrustedPeopleandcert:\CurrentUser\My.Called
Invoke-AddCertToKeyVaultto add the newly generated certificate to myKeyVault.Used the
SetupApplications.ps1script to configure AAD.Placed all resulting strings etc. into
azuredeploy.jsonandazuredeploy.parameters.json, resolved errors (some of which seemed to contradict the documentation..), and successfully deployed the cluster. It is now visible on my Azure Portal.Assigned User Roles (admin to myself) from the classic portal.
Used
Invoke-AddCertToKeyVaultto (this time create and) add a second, "admin client" certificate to the cluster (as opposed to the first which was a cluster certificate).
So, with all of that done, I believe I should have done everything I need to in order to be able to connect to the cluster to publish via VS2015, and access the management interface from api.mydomain.co.uk:19080. Alas, that doesn't happen...
Connection to the database within the resource group my cluster still works from VS via the SQL Server Explorer using SQL authentication, however, any attempt to communicate with the server itself using AAD or X509 based authentication results in a wait while it tries to connect, and then failure. A few examples:
Trying to connect to the management console says it's blocked, which implies to me it is there, but all the documentation ends before telling me how to access it.

Attempting to connect using Connect-ServiceFabricCluster also fails, and searching the error messages hasn't given me any indication of what to do.
After spending two days absorbing all of this and trying to get it working, I'm all out of ideas on what to try and change. Can anyone find a problem in what I have done, or suggest anything I could try? If you need more details from me then please just ask!



