The CloudConfigurationManager.GetSetting
function is overloaded and by default, it will write its results to the Trace log.
The following overload will prevent those messages:
var connStr = CloudConfigurationManager.GetSetting("StorageConnectionString", false);
Assuming the value is located in appSettings, another option is to directly access it via the regular ConfigurationManager.
var connStr = System.Configuration.ConfigurationManager.AppSettings["StorageConnectionString"];
Sidenote:
You might want to consider creating an IConfigFileProvider with a default implementation that accesses the .config file values by key name. Then you can create a secondary implementation to use in your unit tests (or elsewhere) that uses a dictionary to house the values. Depending on what you're doing, you might use one or the other.
In the IConfigFileProvider, you would define functions that automatically return the settings by name, using a default value, type converted (to int, for example), or throw exceptions if the value wasn't found.
I use this approach and it works really well. It allows you to test different config value settings without using a completely different project to do it, while at the same time not forcing you to make changes to your class libraries that might already depend on the config files. So long as you're always retrieving .config settings from an IConfigFileProvider, you're fine.