转换旧版Azure存储配置设置发布者

时间:2015-03-24 23:53:44

标签: azure azure-storage azure-web-roles

我正在尝试更新遗留代码,该代码一直在利用2.0之前的WindowsAzure.Storage。在Application_Start中,有以下内容:

    protected void Application_Start(object sender, EventArgs e)
    {
        var connectionString = "";

        CloudStorageAccount.SetConfigurationSettingPublisher(
          (configName, configSettingPublisher) =>
          {
               connectionString = RoleEnvironment.IsAvailable
                  ? RoleEnvironment.GetConfigurationSettingValue(configName)
                  : ConfigurationManager.AppSettings[configName];
              configSettingPublisher(connectionString);
          });
    }

不确定如何将其转换为新方法...

1 个答案:

答案 0 :(得分:0)

正如Serdar所说,请查看相关问题Azure storage sdk v1.3 to v2 => SetConfigurationSettingPublisher

具体来说,请查看此链接上的#8 http://www.thedailyparker.com/PermaLink,guid,be55f5e0-a041-4d14-aa7b-2966352ad724.aspx

希望这会有所帮助