openalm / Extension-UtilitiesPack

Release Management utility tasks
Other
34 stars 38 forks source link

WebDeploy of tokenizer result #72

Closed steinmr closed 7 years ago

steinmr commented 7 years ago

I'm using the "Azure Web App Deployment"-task in Release Management to deploy my web app. My idea is to use tokenizer to modify the web.config, with different values for each environment. But how is this actually done? I already have the prepared web-deploy package containing the web site as the build output. Must I unpack the package, run tokenizer on web.config and then re-package it before deploy? Or am I misunderstanding the use case here?

devingoble commented 7 years ago

Tokenizer needs paths to the input and output files. So, you'll need to have the files unpacked.

Is the web.config in your package already tokenized?

steinmr commented 7 years ago

Sorry for not updating this, I found the solution.

I have the transform-file checked in with my code, and when building, I copy both config and transform files to a separate directory. I then (during release) run the transform (which tokenizes file amongst other things) and then the tokenizer to replace the actual values with config values. The last step (which was my question), is that after I do web deploy of the website, I create a new web deploy package with only the transformed and tokenized config files, and deploy those (with the DoNotDelete flag).

image

Attached is the powershell to bundle the config files into a web deploy package, if it is useful for anyone finding this.

PackageFilesIntoWebDeployPackage.zip