MSDeploy Skip Directives

Could anyone point me in the direction of a definitive list of files/directories that should not be removed when performing a MSDeploy? I’ve searched the docs/forums but haven’t found anything current.

We’re using the Azure Pipelines IISWebAppDeploymentOnMachineGroup@0 task and I need to define the -skip directive rules to ensure I’m not deleting anything I shouldn’t on deploy!

I would say, if Umbraco is configured correctly in Azure, there should be no need to skip anything. We use docker on a web app and in essence, every deploy is a clean image with no files that remain from the previous deployment. Not sure if you are using a webapp, but here are some things that come to mind:

  • The media and media cache should be moved to a blob. Otherwise you’ll lose your media, or the media cache needs to be rebuild after every release, which will really stress the processor.
  • The logs should be moved to for instance application insights, otherwise, you might want to keep the log files.

  • On Azure, the indexes should be configured like this. Otherwise you might want to keep the index files, otherwise they need to be rebuild every time.

1 Like

Thanks for the reply.

The application is actually self hosted on one of our VMs in Azure. That’s useful to know about the media cache. Unfortunately a blob is not an option for our client but I’ll look at moving the media files elsewhere.

I’m already ignoring the logs so they should be maintained. I’ll look at ignoring the indexes too.

Thanks again.

Here’s what I have in my deployment scripts. Essentially anything that is in the deployment package apart from the media folder should be pushed - but don’t delete anything that is in the destination but not the package.

That can cause issues if you remove a dependency along the way, but since that’s a super rare thing for me, I haven’t looked into a tweak.

 -skip:absolutePath=.*wwwroot\\media
 -enableRule:DoNotDeleteRule