Should I change the configuration in web.config when deploying to a different environment?

Hello.
According to the above guide, do I need to change the web.config if I deploy the project to Test or Prod environment?
For example.
add key=“EnvironmentName” value="Test "
or
add key=“EnvironmentName” value=“Prod”

Thanks!

Hi @jianglili2015,

Thanks for getting in touch! Depending on the requirements of your application, you might need to change some configuration values of it as it moves from one environment to the next. To automate this in Octopus, you can use the built-in feature Configuration Transformations in your Deploy to IIS step which allow you to have environment-specific transform files transform your web.config file differently across your environments.

You can also define environment-scoped variables in your Octopus project, and using the variable substitution syntax (i.e. #{VariableName}) in your files, Octopus will substitute in the matching project variable’s value, picking the appropriate value based on its scoping.

I hope this helps! Let us know how you go, or if you have any further questions. :slight_smile:

Best regards,

Kenny

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.