I deployed a web site in AppHarbor which uses a MS SQL database. AppHarbor provides me with a connection string which I entered in settings.txt
and it seems to work fine BUT AppHarbor suggests to use the SQLSERVER_CONNECTION_STRING
variable instead.
That is because the connection string may change without notice so the only safe way is to use the variable mentioned.
Accessing the configuration variables below should be done programatically, as the values may be updated by the add-on provider without notice.
Is there a way to override the DataConnectionString
setting from settings.txt
and set the application to use the SQLSERVER_CONNECTION_STRING
variable instead? I assume AppHarbor somehow sets those variables as appSettings.
P.S. This is my first application with Orchard, I am not proficient with this CMS.
The connection string is set in the ShellSettingsManager class. I'm not sure you can easily replace this dependency from a module, but you could certainly just change the line of code that sets the connections string...
shellSettings.DataConnectionString = value; //use your config value instead
ShellSettingsManager is an implementation of IShellSettingsManager so you have some flexibility there if you want to just implement your own too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With