So there is a couple of things you need to do in order to correctly setup configuration in Azure.
Any configuration that you plan to use must be defined in the Service Definition and configured in the Service Configuration.
The following service definition defines that I will I have a configuration setting named "myWebRoleSetting", notice that I don't define the value at this point, just the fact that I will be configuring this value for the service. This is defined in my Service Definition (ServiceDefinition.csdef)
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="HelloWorldWeb" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<!-- Must use port 80 for http and port 443 for https when running in the cloud -->
<InputEndpoint name="HttpIn" protocol="http" port="80" />
Once I have defined my configuration setting, I need to specify the value to use at runtime. This is configured in my Serive Configuration file (ServiceConfiguration.cscfg)
<ServiceConfiguration serviceName="HelloWorldWeb" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
<Setting name="myWebRoleSetting" value="Hello World 2"/>
So once i have defined and configured my configuration setting. I will obviously want to access within my application. This is accessed via the RoleManager.
The following sample shows how you access the previously defined configuration setting.
As said in previous posts, that if you want your application to run both in and out of the Fabric, then you will need to abstract configuration into a common class.