Deploying ASP.NET Core 2.0 Apps to IIS with On Premise TFS 2018 Update 1 Release Management

Published: 04 April 2018
Author: Jared Holgate
Category: Continuous Delivery
Tags: TFS Release Management,ASP.NET Core 2.0,Deployments


Please note this article is in draft and I'll update it in the coming days, but some of the bullet points there already may be useful to some people

This article will detail how to setup a CI build and a deployment process to build and deploy an ASP.NET Core 2.0 to an IIS web server. It will details the pre-requisites for setting up the VM. For this article the VM setup will be manual steps, but a future article will automate them.

This article will refer to TFS and Visual Studio. In both cases that is the current latest versions of both, TFS 2018 Update 1 and Visual Studio 2017 15.6.

Initial Setup

First of all we need something to deploy. So create a new ASP.NET Core 2.0 app in Visual Studio and commit to a Git repository in TFS. I'm not going to go into any details about that part as it's not the focus of the article.

If you are using TFS package management, then make sure you push all your nuget packages to TFS. Check both of these folders and push all the *.nupkg files;

You might find this command helpful for pushing the packages;

for /r %i in (*) do nuget push "%i" -source http://[TfsUrl]:8080/tfs/[CollectionName]/_packaging/[FeedName]/nuget/v3/index.json -ApiKey key

Creating a CI Build in TFS

The CI build needs 4 steps as a minimum;

In my example I have also included;

I'll go through each of the steps here and show you how they are configured in my example;

Restore Packages

Build Solution

Run Unit Tests

Copy Integrations Tests to Artifacts Staging Folder

Publish Web App to Artifacts Staging Folder

Publish Artifacts

Setting Up the Target VM

The target VM needs the follow configuration. You can either use a tool like DSC, Puppet or Chef for this or do it manually;

I'll run through each of these steps and show you how they are done manually.

IIS Feature Install

.NET Core 2 Hosting Install

WinRM Setup

Account setup

IIS WebApp setup and configuration

Creating a Deployment in TFS

Now we need to setup a TFS Release definition to deploy the artifact generated in the CI build.

The deployment process only requires 2 steps;

I've also included the following step in my example;

I'll go through each of the steps here and show you how they are configured in my example;

Copy artifacts from build to target server

Deploy the artifact to IIS

Run integration / smoke tests


This article (once completed) has shown you how to get a basic CI build and deployment setup for an ASP.NET Core 2.0 app in TFS. I've not covered every single detail here, so if there is anything I've missed that you need to know, please feel free to contact me.