Deployment Configuration/AppSettings
I'm wondering if there's any mechanism for would allow us to set configuration/appSettings for an environment deployment. Some of our projects are on WAWS and this provides overriding as a host/runtime feature which we find really useful. Would be awesome if there was a way to provide the config at deployment time for hosts that don't provide such features.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 27 Mar, 2014 02:36 AM
Hi Bryan,
So, you'd like to build WebDeploy package in AppVeyor and then deploy it to WAWS (using WebDeploy provider) with changing web.config on the fly (depending on environment/site)?
2 Posted by bryan on 27 Mar, 2014 03:05 AM
Yup, we wouldn't always be deploying to WAWS some would be web deploy to VPS's for example, otherwise we'd just use WAWS's config.
Support Staff 3 Posted by Feodor Fitsner on 27 Mar, 2014 03:24 AM
Well, one of the approaches I can see here is to use WebDeploy packages parametrization (for example http://www.asp.net/web-forms/tutorials/deployment/web-deployment-in...), so you'd have
parameters.xml
in your package.I think we can make AppVeyor setting those parameters during deployment to matching environment variable values. Would it work for you?
4 Posted by bryan on 27 Mar, 2014 04:00 AM
That looks like it will do the job, one more related question, it'd be awesome if we could provide a cloud service .cscfg to the cloud service environment deployment, would allow to deploy one build artifact to multiple environments.
Support Staff 5 Posted by Feodor Fitsner on 27 Mar, 2014 04:11 AM
OK, I've been thinking about that feature. May I ask what would work better: a) an ability to select/specify the entire .cscfg file during the deployment or b) an ability to replace some values (like in case above with WebDeploy) inside the same .cscfg file during the deployment?
6 Posted by bryan on 27 Mar, 2014 04:25 AM
Specifying the entire .cscfg is effectively what one does when uploading the package in the azure portal. Replacing values sounds like it'd be easier but not sure what implications there would be doing that, I've only dealt with simple configs
Support Staff 7 Posted by Feodor Fitsner on 27 Mar, 2014 04:35 AM
Thanks for your thoughts. I will add both items to the issue list and start thinking on their design.
8 Posted by ebenezer.ikonne on 16 May, 2014 04:22 PM
Is there a way to modify web.config settings when using the AppVeyor agent?
Support Staff 9 Posted by Feodor Fitsner on 16 May, 2014 04:45 PM
You have at least two ways to do that:
1) Use Web Deploy parametrization: http://www.appveyor.com/docs/deployment/web-deploy#web-deploy-param...
2) update web.config in
deploy.ps1
script: http://www.appveyor.com/docs/deployment/agent (last two sections)10 Posted by ebenezer.ikonne on 16 May, 2014 04:56 PM
Thanks a lot.
11 Posted by ebenezer.ikonne on 16 May, 2014 06:34 PM
Actually, after testing it looks like the build process actually transforms my web.config based on configuration and what is in the transform file (web.debug.config and web.release.config) which is very cool. Need to test a little bit more but that's nice.
It also seems that has support for handling connection strings via parameters but as you mentioned, looks like Web Deploy would need to be used to leverage that.
Support Staff 12 Posted by Feodor Fitsner on 16 May, 2014 11:48 PM
Yes, web.config transform is a part of web app publishing process.
13 Posted by Dale Holborow on 27 Mar, 2015 07:17 PM
Hi Feodor
Loving the product, setting up some test publish scripts for a new project I'm working on, and trying to perform Unit tests that connect to the db. As part of the test project build process though, a transform Target=AfterBuild that works on my dev machine (to allow custom developer / environment configuration files) doesnt appear to transform the test projects... only the web, and webapi projects that are included. Is this (the Test projects NOT transforming when run in appveyor) something that you control within appveyor the product, or something you think I need to resovle within my solution files?
FYI If i set the Business.Test project's app.config to the settings i requite (appveyor sql server instance and remove the EF DB Logging Interceptor, because i havent figured out how to write logs toa directory structure yet), then everything works perfectly, so its just the transform process itself i am trying to diagnose. Thanks!
14 Posted by Dale Holborow on 27 Mar, 2015 09:25 PM
To follow up, when I make the build process "normal" verbosity, I can see that the Business.Test project in my solution IS apparently having the transformations applied, as per the message below, but when the tests run in the next step, they obviously HAVEN'T been applied, because I know the app.config isn't being transformed with the Debug settings, (although I don't know how to check the file contents to examine them directly - I am guessing I need to figure someway to package and download the deploy package?:
So for my project, as it builds I can see the following messages telling me the transform has taken place:
AfterBuild:
Copying file from "app.Base.config" to "obj\Debug\tempapp.config".
Transforming Source File: obj\Debug\tempapp.config
Applying Transform File: app.Debug.config
Output File: obj\Debug\tempweb2.config
Transformation succeeded
Copying file from "obj\Debug\tempweb2.config" to "app.config".
Done Building Project "C:\projects\myanonproject\myanonproject.Business.Test\myanonproject.Business.Test.csproj" (default targets).
Any ideas?
15 Posted by Dale Holborow on 27 Mar, 2015 10:17 PM
Hi, FYI: I followed this advice (http://stackoverflow.com/questions/15933314/msbuild-how-to-force-afterbuild-target-when-i-do-deployment) and for whatever reason, despite the AfterBuild working fine locally, the transforms need to be BeforeBuild on release to appveyor, but otehr than that i think i have the problem solved. Thanks anyway :)
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:55 AM.