Operations 9 min read

Building a DevOps CI/CD Pipeline with TFS and Docker for .NET Core

This article explains how to construct a complete DevOps pipeline using Microsoft Team Foundation Server and Docker to achieve continuous integration and continuous deployment for .NET Core applications, covering pipeline topology, configuration files, build steps, testing, image creation, and release automation.

DevOps
DevOps
DevOps
Building a DevOps CI/CD Pipeline with TFS and Docker for .NET Core

This guide demonstrates how to use Microsoft Team Foundation Server (TFS) together with Docker to build a full DevOps pipeline for .NET Core, illustrating concepts that are applicable to other languages and platforms.

Pipeline Overview : Developers commit code to TFS (Git or TFVC), triggering CI; a build agent pulls the latest code, compiles and tests inside Docker containers, creates an image, pushes it to a registry, updates docker-compose.yml , and returns artifacts to TFS to start CD.

Pipeline Topology : The diagram shows stages for source checkout, containerized build, unit testing, image creation, and deployment orchestration.

Project Configuration Files :

docker-compose-ci.build.yml uses the official aspnetcore-build image to restore and publish the .NET Core project.

docker-compose-test.yml runs unit tests inside the same build image and logs results.

Dockerfile builds the runtime image from aspnetcore:1.1 , copies the published output, and sets the entry point.

docker-compose-template.yml defines services for the application and a SQL Server database, with placeholders for image tags and environment variables.

Continuous Integration Setup : Install the Docker Integration and Replace Token extensions in TFS, create a build definition, and add steps to execute the above files in order (build, test, image build, push, update compose template, publish test results, and publish the compose file).

Artifacts and Test Results : The build produces a Docker image and an updated docker-compose-template.yml as a Build Artifact; test results are displayed in TFS.

Continuous Deployment Configuration : After CI, the latest compose file is deployed to target environments. Environment variables (e.g., ASPNETCORE_ENVIRONMENT ) determine which configuration file to use. Release steps replace tokens, copy the compose file, and run Docker commands to stop, remove, login to the registry, and start the new containers.

Dashboard : TFS dashboards can show build and release status, recent code changes, and failure reasons for the whole project.

Conclusion : The DevOps pipeline increases deployment frequency, isolates build environments via containers, ensures consistency across environments, and provides real‑time visibility into service health.

dockerCI/CDDevOpsContinuous IntegrationContinuous Deployment.NET CoreTFS
DevOps
Written by

DevOps

Share premium content and events on trends, applications, and practices in development efficiency, AI and related technologies. The IDCF International DevOps Coach Federation trains end‑to‑end development‑efficiency talent, linking high‑performance organizations and individuals to achieve excellence.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.