We have a multi-tenant Umbraco 15 instance and trying to set a few things up for each individual site in the appsettings.json file. Overall, the setup is working very well, however, we’ve found not a lot of plugins support multi-tenancy. We have a need to configure a few things differently for each site. While the sites are sister sites, there are some configurations that are different. For example, SMTP, Application URL, etc.
Is it possible in the Umbraco > CMS node to add a vs. add everything under Global? Or what are the best practices to make this happen? I’m just not finding a lot of information on multi-tenant setup.
Hey Brenden.
I have had similar with your case but just in general as well with some things like a custom mailbox/form solution I have had Defaults for app settings and then just built the nodes for overriding if they are not empty.
So for sites you probably have two primary nodes per site? You got the culture/domain set for each and then all the child content?
In there you have your settings node. Site name and anything like what you mentioned. I often put preferred URL as well just because it can be easier to fetch that in various cases rather than trying to get current domain.
I often have a siteHelper class for specific general functions that can be called, used in views or controllers etc to do things.
You would have a getSiteInfo/Settings or what ever class that defaults the appsettings info but checks the settings node for current parent / active site if they are not empty and if not use those instead.
Is this the sort of thing you were after? thinking?
Technically, you have only one Umbraco instance. Most settings in appSettings.json are meant for the Umbraco instance. Having multiple ‘sites’ in your Umbraco instance is just content that you make accessible by multiple urls using cultures and hostnames.
But there can only be one application url in appsettings and when Umbraco sends mails, you can only use one SMTP. So when you invite a user, it will use the Umbraco instance SMTP and the link to the login page will always be the application url.
If you want more flexiblity, you need to make something yourself. For instance, when we have identical sites, but only the stylesheet and favicon vary, then we would just add a settings node in the content of that particular site so you could set it in content.
But.
If you make two application pools and assign them to the instance but with each domain. You actually get two seperate.
If you have as root items for example…
Site 1
Site 2
Settings
With one application pool both sites can access settings.
Make two application pools for Site 1 and Site 2 and they no longer have access to Settings all the routing etc treats them as seperate and so you would need to put different settings under each.
Still only the one appsettings but you can have more separation as well doing this.