Làm thế nào bạn có thể chuyển đổi điều này trong Azure lưu trữ v2.0 vì "SetConfigurationSettingPublisher" đã bị xóa?Azure sdk lưu trữ v1.3 để v2 => SetConfigurationSettingPublisher
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();
}
}
};
}
);
Cảm ơn