I have a library containing some Azure helper classes. Inside these helper classes I obtain settings such as the Azure account name and key. When running in Azure these sett
The CloudConfigurationManager only supports the AppSettings part of the web.config/app.config and will try to read values from here if the setting is missing from the Azure configuration. The documentation states that it won't read the web.config/app.config if the property RoleEnvironment.IsAvailable is true (running in Azure), but that is incorrect as we can see in the source code below (no check for IsAvailable).
You can take a look at the source to see what happens:
/// <summary>
/// Gets a setting with the given name.
/// </summary>
/// <param name="name">Setting name.</param>
/// <returns>Setting value or null if such setting does not exist.</returns>
internal string GetSetting(string name)
{
Debug.Assert(!string.IsNullOrEmpty(name));
string value = null;
value = GetValue("ServiceRuntime", name, GetServiceRuntimeSetting);
if (value == null)
{
value = GetValue("ConfigurationManager", name, n => ConfigurationManager.AppSettings[n]);
}
return value;
}
As you can see, there is only one call to the normal ConfigurationManager class that simply accesses the AppSettings.