Thursday, June 24, 2010

Windows Azure – Custom configuration settings

Few days back, I received a question on our internal Azure discussion DL regarding, how we can have settings defined in a web configuration file implemented in a web role. In simple terms, how we can have configuration file in a Windows Azure application.

This is how we can do this;

During development

  • ServiceDefinition.csdef – Add name of your custom configuration


  • ServiceConfiguration.cscfg – Add value to your custom configuration


  • Now, use this custom configuration in code


When you publish this project, generated ServiceConfiguration.cscfg will have your custom configuration key value pair. You can also modify this after you deploy your app in the cloud.

Technorati Tags: ,