Search code examples
asp.netiistfsvisual-studio-2017octopus-deploy

migration from Octopus to TFS 2017 - Publishing ASP.NET web sites


We currently use Octopus Deploy to push web sites to IIS servers hosted on Window Server 2012.

We wish to ditch Octopus and use our on-premises TFS 2017's inbuilt release system instead. We have build definitions that publish artifacts (the web site binaries & content) ready made .

With Octopus we have tentacles installed on all the servers.

The legacy release process defined in Octopus is like so:

  1. Set up IIS (Powershell script to configure app pools for a site, map virtual directory to absolute path)
  2. Deploy nuget package (package contains web site binaries & scripts) - unpacks package containing web site to the physical path of the associated virtual directory
  3. Enable Windows Authentication (one-line powershell script that calls Set-WebConfigurationProperty)
  4. Disable Anon Auth (powershell again.)

I'm not keen on the amount of Powershell used in our Octopus process, and would like to minimise Powershell in the TFS release definition.

My question is: what is the Microsoft recommended way of deploying ASP.NET web sites (vanilla MVC projects, not .NET core) to servers in a CI environment? Is it possible to configure the sites authentication at the same time?

NB: I took a look at the OOB IIS publishing WinRM deployment tasks and I fear they may require more time than our infrastructure team has (to configure firewalls etc.)

We have Visual Studio 2017 installed on the build server.

TIA, Scott


Solution

  • According to your description you are deploying on a Web site hosted on IIS.

    First through TFS build you could use some msbuild arguments such as /p:DeployOnBuild=True /p:SkipInvalidConfigurations=true /p:WebPublishMethod=Package /p:PackageLocation=$(Build.ArtifactStagingDirectory) /p:PackageAsSingleFile=true to generate a package.

    Then in release definition use Deploy: Windows Machine File Copy task - Copy the Web Deploy package to the IIS servers. Finally use Deploy: WinRM - IIS Web App Deployment - Deploy the package. This task running on the Build and Release agent opens a WinRM connection to each IIS server to run Powershell scripts remotely in order to deploy the Web Deploy package.

    For more detail/step to step tutorial, you could reference below tutorials, even some are the samples for web app: