提供的凭据“{0”}不能用于签署请求

时间:2013-05-22 11:49:46

标签: azure-storage

使用共享访问签名使用StorageClient Library 2.0获取表数据时,我一直收到错误“提供的凭据'{0'}不能用于签署请求”。从GitHub我可以理解的是,错误是由于sasCredentials.CanSignRequest返回false ...但是根据GitHub中的代码,没有任何情况应该返回true ...它是一个bug ...还是我我在这里做错了什么?

StorageCredentials sasCredentials = new StorageCredentialsSharedAccessSignature(sharedAccessSignature); CloudTableClient ctc = new CloudTableClient(tableEndpoint,sasCredentials);

1 个答案:

答案 0 :(得分:0)

Azure Storage Client Library 2.0中不存在

StorageCredentialsSharedAccessSignature类型。因此,我假设您仍在使用旧版本,最可能是1.7。正如Introducing Table SAS (Shared Access Signature), Queue SAS and update to Blob SAS博客文章中所述,在Azure存储客户端库的较新版本中添加了对Table SAS的支持。

我强烈建议升级到2.0,除了您正在寻找的功能之外,还有许多其他改进。有关详细信息,请参阅Introducing Windows Azure Storage Client Library 2.0 for .NET and Windows Runtime