Dump to myself:

CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =>
{
string connectionString;

if (RoleEnvironment.IsAvailable)
{
connectionString = RoleEnvironment.GetConfigurationSettingValue(configName);
}
else
{
connectionString = ConfigurationManager.AppSettings[configName];
}

configSetter(connectionString);
});