How could you convert this in Azure storage v2.0 since "SetConfigurationSettingPublisher" was deleted ?
CloudStorageAccount.SetConfigurationSettingPublisher(
( configName, configSetter ) =>
{
// Provide the configSetter with the initial value
configSetter( RoleEnvironment.GetConfigurationSettingValue( configName ) );
RoleEnvironment.Changed += ( sender, arg ) =>
{
if( arg.Changes.OfType<RoleEnvironmentConfigurationSettingChange>( ).Any( (change) =>
( change.ConfigurationSettingName == configName ) ) )
{
// The corresponding configuration setting has changed, so propagate the value
if( !configSetter( RoleEnvironment.GetConfigurationSettingValue( configName ) ) )
{
// In this case, the change to the storage account credentials in the
// service configuration is significant enough that the role needs to be
// recycled in order to use the latest settings (for example, the
// endpoint may have changed)
RoleEnvironment.RequestRecycle();
}
}
};
}
);
Thanks