gpt4 book ai didi

azure - SAS URL 不起作用

转载 作者:行者123 更新时间:2023-12-03 20:18:35 27 4
gpt4 key购买 nike

我正在尝试为 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

我尝试了旧的存储资源管理器:

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

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

最佳答案

您正在容器上创建 SAS,并且您似乎正在尝试在浏览器中读取该容器。当我将容器 SAS 粘贴到浏览器中时,我收到与您相同的错误。

容器 SAS(具有读取权限)为您提供对容器中 Blob 的读取访问权限。因此,在将 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 附加到基本 URL:

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

关于azure - SAS URL 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37307981/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com