0

我在执行blobcontainer.CreateIfNotExist();我的工人角色时遇到问题,说明这一点:

Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

在开始时,我认为问题可能是我的本地计算机日期(因为我来自南美洲)所以我添加了 Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;但错误仍然存​​在..

我获取与存储连接的配置的方式是这样的:

 var storageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("dataconnectionstring"));

这是:

<Setting name="dataconnectionstring" value="DefaultEndpointsProtocol=https;
               AccountName=devstoreaccount1;
               AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" />

可能是什么问题呢?

4

1 回答 1

0

问题在于您的连接字符串。我看到您正在尝试连接到开发存储(存储模拟器):

<Setting name="dataconnectionstring" value="DefaultEndpointsProtocol=https;
           AccountName=devstoreaccount1;
           AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" />

如需连接开发存储,请按以下格式指定连接字符串:

<Setting name="dataconnectionstring" value="UseDevelopmentStorage=true" />

请使用您使用的格式来指定与云存储帐户的连接。

于 2013-03-31T03:22:47.937 回答