Json settings files supported in deployment
Hi,
So currently there is good support for setting xml settings via
parameters.xml.
Would it be possible to add json support? A simple way to do this would be to mimic the route Asp.Net Core has taken with it's configuration API.
In a project you might have appSettings.json
, then
you could also create an appSettings.appveyor.json
that is merged during deployment. It doesn't need to be a full copy
of appSettings.json
but could just contain a subset of
it. This approach works really well in Asp.Net Core and is super
simple to understand and maintain.
Thoughts?
Keep being awesome, thanks,
Lee
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 21 Sep, 2016 08:19 PM
When
parameters.xml
is used it's "baked" into resulting Web Deploy package and then you can specify parameters during deployment. So, you can use the same immutable package and deploy it over and over to multiple environments.I'm not very familiar with
appSettings.json
- do they follow the same approach or it's build-time thing?2 Posted by leecheneler1 on 21 Sep, 2016 09:43 PM
So they do it at runtime, but it would be amazing if you this could be done during an appVeyor deploy as json is the future, xml is dead in the water....
Proposed solution
You might have a json settings file
appSettings.json
with:And then you could have an appveyor deployment json file next to it called
appSettings.appveyor.json
:Then these 2 files are merged, with properties in the appveyor file overwriting any matching properties in the actual settings file. The way Asp.Net Core merges config you could just overwrite a small part of the config file like this:
Asp.Net Core is making a huge push into the json space for configuration as its much more natural to express settings objects in json.
Current solution we have in place
Our current solution is the following:
Deployment environment variables configured in appveyor.
Node script to update the json settings called
appSettings.appveyor.js
:Then we run that with a
deploy.ps1
script during the appveyor deployment:Support Staff 3 Posted by Feodor Fitsner on 22 Sep, 2016 09:37 PM
Thanks for your thoughts!
4 Posted by Alisson on 18 Jun, 2018 05:43 AM
How do we run this `deploy.ps1` script during the deployment?
5 Posted by Ilya Finkelshte... on 18 Jun, 2018 06:32 PM
@Alisson Can you clarify more about your deployment? Is it inline or environment deployment (difference described here)? Is it agent deployment?
Owen McDonnell closed this discussion on 27 Aug, 2018 08:42 PM.