[Solved] Different runtime modes
# help-with-umbraco
c
V13.5.2 A question about appsettings.{env}.json files. We have a project in development and about to go live on Client's Azure infrastructure. Therefore we have our appsettings.Developemnt.json for our local dev machines and we have the appsettings.Production.json on our own test server. Now the client wants to use another two environments, namely "Test" and "Live". I thought it would be fine to copy our Production appsettings file twice and call one appsettings.Test.json and the other appsettings.Live.json, but when changing the Runtime Mode settings to "Test" and "Live" I get a warning saying "Value should be one of: "BackofficeDevelopment", "Development", "Production" ". What do we do in this situation, or can this warning just be ignored? Any advice appreciated.
Having just re-read the docs on this, I'm of the opinion the Runtime Mode is just controlling how Umbraco works, so both the Test and Live should have their Runtime Mode set to "Production". However am I right in thinking that an appsettings.Test.json file will only run on an environment called "Test"? If so, I'm home and dry, but need someone to confirm as I can't try it out for real 😉
k
hi yes, the appsettings.[mode].json file is actually using the value of the
ASPNETCORE_ENVIRONMENT
evironmental variable while you are working locally this is set to "Development" (actaully done in the properties/launchsettings.json file). when you are running on Azure i think this is an environmental variable you set. (haven't looked at the Azure UI in a while and it changes) so in theory you can set this variable to "Test" or "Live" and then appsettings.test.json or appsettings.live.json will be used and merged into the appsettings.json file. the umbraco "production" mode is as you have read - for setting umbraco to run in production, it tunes things internally for umbraco and sets up certain expectations that make it run better "live"
c
Thanks for confirming Kevin. That's great 🙂
l
You are correct 🙂
In this case appsettings.json will be used and merged with appsettings.acceptance.json
28 Views