Integration testing Service Fabric & Traefik with Docker

Here is the plan:

  1. Use docker to run a Service Fabric Linux cluster in a container
  2. Deploy a test app to the cluster and create 25 instances of it

Aim: While developing the Traefik SF integration it will provide a simple cluster to use, debug and perform integration testing.

*TLDR: Have a look the full code in this PR

It was a fun journey but I got it working…

Continue reading

Azure, How to

PubSub in Service Fabric with Redis

I’ve been working on a project that uses Fabric and I’m hosting Redis inside the cluster as a simple cache system.

One of things that isn’t baked into Fabric is a pub/sub model for communicating between services  about events that are occuring.

As I’ve got the Redis instance up and running in the cluster I decided to take a look at using the Pub/Sub capabilities in Redis to make this happen. N.B Redis isn’t a guarenteed delivery so use where appropriate, there are lots of discussions around it’s pub/sub model and when/where to use etc.

Turns out it’s nice and easy to get working, I’m a big fan of using RX to make nice reactive programs operating on streams of events and there is already a nice sample combineing Redis and RX in C# here.

In not too long I had just what I wanted and through it might be useful to others so I’ve put together a sample. My sample is here with one “EventPublisher” service pushing out events and an “EventSubscriber” listening to events.

Both services write out what they’re up to as ETW messages so you can view in the diagnostic window.



Lawrence Gripper


Azure, How to

Service Fabric: Getting started with a frontend website and a partycluster

This is going to be a quick guide to spinning up an ASPNET 5 website on Service Fabric.

To host it we’re going to use the “Party Cluster” service from the team. This lets you grab a slot on a free public Service Fabric cluster to try out things and get up to speed.

So first things first, head over to the Party Cluster site and sign up for a cluster.


Once you’ve requested access to a cluster (Tip: Pick the one with the most time left to run on it!) you’ll get an email like this one.


The three key bits of info are highlighted, we’ll use these to host our website! Have a read of the rest of the mail too as it details the limitation of the party clusters, limited time, shared etc.

First up the green circle is the link you can use to see the Service Fabric Explorer, we’ll use this later to see our app provision and check it’s health.

Second is the connection address and the port you’ve been allocated, our site will end up being hosted at the connection address plus our application port so in this case

Now lets create our website and publish it to the cluster! I’ll assume at this point that you’ve followed the install guides for getting your local environment setup, don’t worry if you haven’t .. I’ll wait. Head here and follow the guide.

Continue reading