-1

I'm trying to setup CI via TFS 2015, I've got a solution that has got 2 main Web application that currently we deploy manually editing the config files and so on (which sometimes leads to errors)

I've read about build/release process and in the past I've used Jenkins as build server. But till today I've got a question and that's related to when apply the transformation of XML config files.

In my current VTFS2015 setup I've created a build process and I build the project with the following line

msbuild /p:Configuration=Test /p:PublishProfile=Test /p:DeployOnBuild=true xxx\xxx.csproj

This creates me in the folder obj\Test\Package\PackageTmp the package

Is this ok? or should this be done in the release management tab? Consider in my farm I've

  • Test (from DEV trunk)
  • Staging (from Dev trunk as well)
  • Production (from production trunk on 3 machines)

My goal is to have them automatically delivered on the machines, but I don't know the right moment to apply the transformation (during the build I can use the publish feature, during the RM I can use a ps1 script)

Thanks in advance

advapi
  • 3,661
  • 4
  • 38
  • 73

1 Answers1

1

Well, I think this thread will helps: What TFS 2017 build task applies web.config transforms during TFS builds?

To apply the transformations you can use the extension: Apply transformations in vNext build process.

Usually it should be a package and be used in a deploy task such as Deploy: WinRM - IIS Web App Deployment or Azure App Service Deployment to achieved the deployment.

1) Can transforms be engaged in both Builds and Releases?

Yes, you could also do this in a build pipeline with the useage of build deploy task. You need to add the task after the publish build artifacts task.

2) Does TFS 2017 require a lot of special handling to engage a transform file?

update

The BuildConfiguration variable is different in TFS 2017, it's inside the MSBuild task! Transforms are now applied according to the MSBuild task Configuration setting.

Edit the .proj file is a method to do the transform. If you don't need to change the transform, it will auto do it during the build.You could also use some 3-rd party task/extension for extra transform such as: XDT Transform

Usually we separate the build and release for the deployment, cause it's easy to configure multiple environments and easy to debug issue. You definitely could do this only in build but with a bloated process. You could refer this tutorial: Build and Deploy Azure Web Apps using Team Foundation Server/Services vNext Builds.

For a separate build and release solution, you could take a look at this blog: Using web.config transforms and Release Manager – TFS 2017/Team Services edition

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55