3

We are using habitat in our project for a multisite implementation.

Can we setup the ConnectionStrings.config transformation in the Project/common layer of the habitat framework. Is this doable?

1

You can do this. You would just need to add the config file to the project and it will get published with the rest of the files and it will overwrite the file in the webroot.

I would question if you should do this tho. The connection strings get set when you install the Sitecore instance. So each developer should already have that set. If you put this file in the project and thus source control, you either need to make sure all devs have the exact same machine setup or they will have to make changes and not commit those.

Also you end up potentially having SQL Server logins stored in plain text. Not something I would be comfortable with. So while you can do it, I would recommend not doing it.

Edit

Environment Transforms

As an update to the previous answer, I agree totally with @jammykam. If you need to update connection strings per environment, that is where you need to tokenize your values in the source file and then use your release management tool, whether that be Octopus Deploy, TFS Release Manager etc... to substitute those tokens with the real values.

For local development, you can then use a .debug.config transform and a tool like SlowCheetah to make sure your development values are added. That is how I work with all configs not just the connection strings.

  • 1
    We have a config transform that sets Octopus Deploy variable tokens. ConnectionString details are set in Octopus and not source control... agree with not storing these in source control but it is doable (and sometimes practical for several reasons) – jammykam Oct 29 '17 at 16:33
  • thanks Richard and jammykam. We mainly need this for the setting different connection string values for the the different environment. Since we are using Octopus, hope it will be good to set the variables in script for each environment – PVM Oct 29 '17 at 23:43
  • Hi Richard,We are planning to use the Octopus that can tokenize our values in the source-file. – PVM Nov 1 '17 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.