I am trying to configure some key/value pairs for my Azure web application using app settings section on Windows Azure preview portal.
Now I am trying to read values like below
ConfigurationManager.AppSettings["MyWebApp.DbConnectionString"];
but it returns null values.
Reading app settings from Web.config in my web application works fine.
I found the solution.
Keep values in web.config as well as in Azure App setting. When you are running/debugging application on your local environment it picks values from web.config.
When you deploy application on Azure it picks values from App setting.
//Below code work for both.
ConfigurationManager.AppSettings["KeyName"]
Keep key name same in web.config as well as in Azure app setting.