Via VSTS I am trying to automate the following process which is currently performed manually:
- Within VS 2017 perform a publish to file system.
- Set settings in web.config.
- Repeat 1 & 2, for each environment, e.g. Test, UAT, Production, etc.
- Copy those files to an FTP server.
- Logon to secure infrastructure, download files from FTP, and copy into place on IIS target servers.
The secure infrastructure is locked down, and has limited internet access. The FTP is used as a way to move files into that infrastructure.
Within this question I specifically want to address elements; 1, 2, and 3.
The struggle I am having is that VSTS seems setup to deploy web apps into Azure Web Sites or publicly accessible IIS. Whilst IIS is my eventual target, initially I was hoping to achieve a file system deployment - similar to what VS 2017 provides.
I have tried using MSBuild to create a package, using; /p:WebPublishMethod=Package /p:PackageAsSingleFile=true
.
Then MSDeploy to extract the package into a folder msdeploy.exe -verb:sync -source:package="Package.zip" -dest:contentPath="content"
.
However that results in the following error Source (sitemanifest) and destination (contentPath) are not compatible for the given operation
.
It looks like I can use MSBuild and /p:DeployOnBuild=true /p:PublishProfile=VSTS
to deploy to a folder at build time, but that seems a little awkward within the structure of VSTS. E.g. I have to repeatedly build the solution for each environment.
After I have the solution deployed into a folder, I intend to use VSTS to push to FTP.
Is there a better way to do this? For example; VSTS Azure deploy provides the ability to easily set connection sting parameters.