2

At the moment the software is build each time we deploy to Windows Azure. We deploy the same software version to every customer. The only difference is some config files with for example a different database connection string.

Is it possible to use a prebuild Windows Azure package, which is the same for every deployment, and somehow inject the config files?

Simon de Kraa
  • 415
  • 2
  • 6
  • 18
  • Do you need any further advice on this issue? – GraemeMiller Jan 30 '13 at 09:19
  • I intend to proceed with this option, but as it is a big change for us it needs to be scheduled in the next couple of weeks. Thank you for all that responded. I will probably get back on this at a later stage. Thanks. – Simon de Kraa Jan 31 '13 at 09:41

1 Answers1

2

Look at using CloudConfigurationManager class

CloudConfigurationManager.GetSetting(key);

Basically it looks in the Azure service configuration first and then in the web.config if not specified in Azure configuration file. You can deploy the same site to different Cloud services and just need to change the Azure configuration. You can also change it without re-deploying

See this question

Azure configuration settings and Microsoft.WindowsAzure.CloudConfigurationManager

Community
  • 1
  • 1
GraemeMiller
  • 11,973
  • 8
  • 57
  • 111
  • We don't specifically use CloudConfigurationManager but we do follow this exact strategy with some internally-developed infrastructure classes. In dev/debug environments, we have our connection strings in `app.config` and `web.config` files but in Azure, everything goes into a `.cscfg` that we apply XSLT transforms to on a per-customer basis. We deploy a suite of ~12 different apps across ~8 different duplicated Azure environments (different hostnames, certificates, etc). – Jaxidian Jan 21 '13 at 11:26