SAS URL无效

时间:2016-05-18 18:55:21

标签: azure azure-storage

我正在尝试为blob存储容器创建SAS URL。我尝试了多个存储帐户和多种创建SAS的方法,当我在浏览器中测试SAS URL时,所有这些都会给出这个结果:

<Error>
<Code>AuthenticationFailed</Code>
<Message>
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:d95bf34f-0001-0022-4430-b1a25b000000 Time:2016-05-18T18:12:30.5552096Z
</Message>
<AuthenticationErrorDetail>
Signature did not match. String to sign used was rl 2016-05-18T18:10:00Z 2016-05-19T18:10:00Z /blob/cloudappmanager/$root 2015-04-05
</AuthenticationErrorDetail>
</Error>

我尝试了Storage Explorer(右键单击容器,获取SAS,单击确定以默认值): enter image description here

我尝试了旧的Storage Explorer:

enter image description here

我尝试了PowerShell:

PS C:\Users\virklba> $context = New-AzureStorageContext -StorageAccountName msuscoreaprod 
cmdlet New-AzureStorageContext at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
StorageAccountKey: xxxxxxxxx

PS C:\Users\virklba> New-AzureStorageContainerSASToken -Name aadlogs -Context $context -FullUri -Permission rl
https://msuscoreaprod.blob.core.windows.net/aadlogs?sv=2015-04-05&sr=c&sig=xxxxxxxx&se=2016-05-18T19%3A47%3A56Z&sp=rl

所有结果都相同。是否有其他人看到这种行为,还是仅仅是我?

2 个答案:

答案 0 :(得分:3)

您正在容器上创建SAS,看起来您正试图在浏览器中读取容器。当我将容器SAS粘贴到浏览器中时,我得到了同样的错误。

容器SAS(具有读取权限)使您可以读取容器中的blob。因此,在将其粘贴到浏览器中之前,需要将一个blob名称附加到SAS,以便读取blob。

例如,这不起作用:

https://myaccount.blob.core.windows.net/lotsofblobs?st=2016-05-18T22%3A49%3A00Z&se=2016-05-19T22%3A59%3A00Z&sp=rl&sv=2015-04-05&sr=c&sig=62WHwaZGI60ub1hYcQyKg1%2FE%2F1w9HUrOPGorzoWDLvE%3D

这确实有效,将myblob.txt附加到基本网址:

https://myaccount.blob.core.windows.net/lotsofblobs/myblob.txt?st=2016-05-18T22%3A49%3A00Z&se=2016-05-19T22%3A59%3A00Z&sp=rl&sv=2015-04-05&sr=c&sig=62WHwaZGI60ub1hYcQyKg1%2FE%2F1w9HUrOPGorzoWDLvE%3D

请在此处查看Gaurav Mantri的详细说明:Azure Shared Access Signature - Signature did not match

答案 1 :(得分:0)

要解决此问题,请先尝试连接存储帐户,然后再连接 Blob。

相关问题