One of the value propositions of using containers with Service Fabric is that you can now deploy IIS based applications to the SF cluster. In this blog post, we will see how to leverage docker containers to deploy IIS apps to Service Fabric. I will skip the image creation and publish to the docker hub in this blog. Please reference my earlier blog to learn more about creating and pushing images.
For this blog, I will be using an already pushed IIS image to the docker Hub. The application image uses microsoft/iis as a base image.
Let’s get started.
Step 1. Open Visual Studio 2017 and create a Service Fabric Application.
Step 2. Now choose the Guest Container feature and provide valid Image Name and Click Ok. The image name is the one we published to Docker Hub in the previous exercise.
Step 3. Once the application is created and loaded, add the following endpoint information into ServiceManifest.xml
Step 4. Now let’s add following section into ApplicationManifest.xml to add Hub Credentials and Port Binding endpoint information.
Step 5. We are ready to Publish our application to Service Fabric Cluster now. Right click on the Application and Publish to Azure Service Fabric. Make sure when you create the Service Fabric cluster, you pick the option to create it with Windows Server 2016 with Containers.
Step 6. First let’s see our application deployed using Service Fabric explorer.
Step 7 Now, lets browse to our application on Service Fabric. You should see your IIS application running on Service Fabric.
As you saw in this blog post we can use Service Fabric for Container Orchestration for newer and legacy applications. More coming in next blog on Container Orchestration capabilities like DNS, Scaling, Labels etc.. Stay tuned!