繁体   English   中英

Azcopy 无法使用 sas 令牌从 azure 文件存储下载文件?

[英]Azcopy fails to download file from azure file storage using sas token?

我正在尝试将文件下载到在 azure 上运行 CentOS 的虚拟机。 linux box安装了azcopy 我正在尝试使用生成的 SAS 令牌从 azure 文件存储下载文件,但无法下载。 我是否误解了如何使用 SAS 令牌?

最终我能够使用密钥而不是 SAS 令牌下载文件。 所以我知道网址是正确的。

我使用 linux vm 的公共 ip 为存储帐户创建了一个 sas 令牌,然后将其复制并附加到文件 url 中。 我创建了一个 CORS 规则来允许所有 ip 地址。 我在我的本地机器上重复了这个(使用它的公共 IP)并且能够获取文件。 当我在 vm 上运行相同的命令时,它失败了。

我尝试使用附加到 url 的 sas 令牌运行它,并将其作为单独的参数传入。

azcopy --source "https://mynamehere.file.core.windows.net/pathtofile/file" --source-sas "?sv=2018-03-28&ss=...&srt =...&sp=...&se=2019-04-04T21:53:38Z&st=2019-04-04T13:53:38Z&sip=...&spr=https&sig=..." --destination file --verbose

我不断得到

[VERBOSE] Location 'Cloud file: https://mynamehere.file.core.windows.net/pathtofile/file' does not exist, This request is not authorized to perform this operation.
HttpStatusMessage:This request is not authorized to perform this operation.

[ERROR] Error parsing source location "https://mynamehere.file.core.windows.net/pathtofile/file": Source with location type File doesn't exist.

请检查您用于访问存储的 sas 令牌的权限(读取、写入、删除)和到期时间

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM