0

I am using WebDeploy and am running into an issue that I can't seem to get around. First, I will outline my ideas and then get into the issue I am having.

Currently, we have many applications running under the the root directory of a website in IIS. We want to be able to roll out and roll back on an application level, not a website level.

When we want to roll out an application, the user will create a webdeploy package in IIS. They will then roll this out using Web Deploy. Currently, when WebDeploy rolls out an application, it takes a backup of the entire website (many applications) in case we need to roll back. This works well for rollouts, but rollbacks are where I am having my issue. See, On a rollback, I dont want to rollback the entire website. I only want to roll out what has changed during this rollout. This is important to avoid stepping on the toes of other rollouts that may be in progress.

To satisfy this requirement, I have written code that essentially Diffs the initial rollout package with the backup package. If the file was present in the initial rollout package, we grab that corresponding file in the backup package. Once we have all the files from the backup that correspond to the initial rollout, I copy the systeminfo.xml, parameters.xml and archive.xml from the backup and use all these files to create a new zip file which I will refer to as the Rollback package. Now, the rollback package has the exact same folder structure as the backup package, it is simply missing the files from the backup that were not replaced in the initial rollout. The issue I am having is that when I send off this new rollback package to the web deploy api, I do not get any error messages, but the files on the webserver were not replaced by the rollback files. Upon further investigation, I have found that the web deploy api returns a DeploymentChangeSummary object. This object shows all zeros for bytes copied, files replaced, etc (basically nothing was replaced but web deploy shows no errors). When I pass the entire backup file through the same code, the files on the web server are replaced and the DeploymentChangeSummary shows files and bytes copied out.

Why can I Roll out an entire backup of the website, but not a partial one? I have a feeling this could have something to do with copying the .xml files from the backup to the rollout because they might need to be modified but I'm not sure. Also, I am not using a checksum.

CW2272
  • 183
  • 1
  • 10

1 Answers1

0

I would suggest running the MSDeploy.exe command manually to target on the web application you want to package. If you keep an archive of these packages and when they are applied to the target server your rollback can simply be rerunning the last good package.

"c:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:manifest="manifest.source.xml" -dest:package=websitepackage.zip

The following post walks through the steps of manually creating a package from the commandline. In this case its for an ASP.NET Website but will work with any ASP.NET site/application:

http://www.dotnetcatch.com/2016/06/23/deploy-an-asp-net-website-not-web-application-with-msdeploy/

chief7
  • 14,263
  • 14
  • 47
  • 80