Martin
Martin

Reputation: 1536

Modify App Pool with Web Deploy and TeamCity

We are using Teamcity and deploy our websites with the msbuild MSDeployPublish target. This works fine, but we also want to ensure that the application pool on the server we deploy to has the "Load User Profile" set to true.

How can we do this?

If not possible with MSDeployPublish, can it be done with a commandline-step and MsDeploy.exe?

Upvotes: 0

Views: 754

Answers (1)

Richard Szalay
Richard Szalay

Reputation: 84784

It's not possible using MSBuild, but it's possible using MSDeploy.

MSDeploy won't let you specify the settings directly, but it will let you back up an app pool and apply it to another server (it will modify differences in settings if there are any).

First, you need to backup your settings and commit them to SVN:

msdeploy -verb:sync 
         -source:appPoolConfig="name of your apppool"
         -dest:package="apppool.zip"

During compilation time, you need to sync the output package into the appppol package, since a manifest provider can't include a package/archivedir provider:

msdeploy -verb:sync
         -source:ApplicationPackage.zip
         -dest:appool.zip
         -skip:skipAction:Delete

(The skip prevents the deploy from deleting the appPoolConfig provider from the target package)

NOTE: Don't do this the other way around (apppool.zip into ApplicationPackage.zip) as it will delete all your declared parameters and I'm not sure how to skip that.

It's probably possible to copy apppool.zip "underneath" ApplicationPackage.zip before it's generated (via MsDeploySourceManifest) so it actually merges in one step, but I'll leave that as an exercise for you until I get the time to test it.

NOTE: You could also use dest:archivedir if you'd rather have files in a directory than a zip

Upvotes: 1

Related Questions