Continuous Deployment of Service Fabric Apps using VSTS
Using the Sample
There are a couple of files that you'll need to edit in order to get this to work:
Edit the ARM templates There are two templates in the ARM project: one for a test environment and one for prod. Currently these both set up an unsecured cluster of 3 nodes. The easiest way to get your ARM template is to log on to the Azure portal and create a new Service Fabric Cluster. At the end of the journey, just before clicking create, there is an "Export Template" button which you can use to export the ARM template. I extracted some of the parameter values into the
parameters.jsonfile, but that's just a personal preference.
The templates are in
Edit the Profiles There are three profiles: Local, TestCloud and ProdCloud (each with their associated ApplicationParameters). You'll need to edit the ProdCloud XML to make a secure connection (the sample uses an unsecure one) and you'll need to edit the ApplicationParameters files to suit your application.
The profiles are in
src/VisualObjects/VisualObjects/PublishProfiles. The app parameters files are in
To demo the pipeline, create the build and release as outlined in (this post)[http://www.colinsalmcorner.com/post/continuous-deployment-of-service-fabric-apps-using-vsts-or-tfs].
Run the build and release to Test. Browse to the test application endpoint:
http://clustername.eastus.cloudapp.azure.com:8082/VisualObjects (where clustername is the name of your cluster). You should see some bouncing triangles.
Then you can edit
src/VisualObjects/VisualObjects.ActorService/VisualObjectActor.cs in Visual Studio or
in the Code hub in VSTS. Look around line 50 for
and change it to look like this:
Queue a new build (or look for the one that the CI triggered) and wait until it has released to Test. Keep watching the triangles - you should see them start to rotate as the Actors are upgraded.