In TFS 2013 Xaml build and Msbuild we have the possibility to generate a folder _PublishedWebsites that contain the files result for the web project compilation.

Published website

In new build system Vnext build for TFS 2015 and VSTS, for generate this folder during build compilation, into Visual Studio Build (or MSbuild) Task, add MsBuild Argument /p:outdir with the destination of the compilation ouput, for example : /p:outdir=$(Build.BinariesDirectory.

Msbuild arg

After the build execution, we can see the _publishedWebsites folder in the specified directory.

published folder

The next step is to publish into artifacts only the content of the _Publishedwebsites directory for deploy it with Release tool. For this, configure the Copy Publish artifact task for publish only the content of _Publishedwebsites folder.

Content Args

And result of the published artifact is:

Artifacts explorer

If the solution contain multiple web projects 1 directory by web site is created under _PublishedWebsites folder.

Artifacts explorer 2

We get the web site content and it ready to be deployed.