We have tried lots of features to collaborate wtih Service Fabric, VSTS and Docker containers. I have realized it's needed to describe overview of the architecture, so you can learn the architecture following this article.
Overview of Service Fabric, VSTS and Windows Container architecture
At first, refer to the architecture diagram below.
You have to create below resources to setup this architecture.
- Service Fabric cluster
- VSTS Proejct, Build Process and Release Process
- Azure Container Registry
- Virtual Machines for VSTS Private Agent
In this article, you can find references to Service Fabric cluster, VSTS and Virtula Machines. But please create Azure Container Registry for yourself and it should be quite easy.
a - Setup Private Agent for VSTS Build Definitions
Unfortunately, Windows Docker base image sizes are about 1.5G. It takes much time to download and build Docker images if you don't use Pirvate Agent. By caching the Docker images, its building time can be largely reduced.
b - Setup connections for Service Fabric cluster deployment
You need to setup Service Fabri cluster at first, but note when you choose instance type. Refer to What is workaround when you got error message "failure in a Windows system call: No hypervisor is present on this system." on Service Fabric Explorer - normalian blog when you use hyper-v isolation type.
- What is workaround when you got error message "failure in a Windows system call: No hypervisor is present on this system." on Service Fabric Explorer - normalian blog
- Step by step how to setup Service Fabric Explorer on Azure - normalian blog
- How to setup Service Fabric connections on VSTS - normalian blog
1. and 2. Create Build Definitions to make Windows Docker images and deployment artifacts
- How to build ASP.NET Framework Docker images on VSTS build tasks - normalian blog
- Create Service Fabric Deployment Package with Docker images on VSTS Build Task - normalian blog
Note to choose Windows Docker base image. Unfortunately, it needs to be compatible between host OS and guest OS.
You probably need to read below articles when you need to use your project name or something environment variables for Docker image names.