azure - 在同一 Azure 存储帐户下的两个 Azure 文件共享之间传输文件

标签 azure azure-storage azure-storage-files

我想要将文件从文件共享 x 复制到文件共享 y 中同一 Azure 存储帐户下的目录。但是我收到身份验证错误。这是我尝试过的:

 az login
 azcopy copy "https://mystorageaccount.file.core.windows.net/x/mydir/myfile.dmp?sv=2021-06-08&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2022-08-18T14:11:48Z&st=2022-08-18T13:11:48Z&sip=myip&spr=https&sig=****" "https://mystorageaccount.file.core.windows.net/y/mydir?sv=2021-06-08&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2022-08-18T14:14:18Z&st=2022-08-18T13:14:18Z&sip=myip&spr=https&sig=****"

我对源和目标使用相同的 SAS token ,因为这两个文件共享位于同一存储帐户下。

由于出现错误,我尝试生成一个使用 Key1 作为源的 SAS,并生成一个使用 Key2 作为目标的 SAS,但没有成功。

错误:

 INFO: Trying 4 concurrent connections (initial starting point)
 INFO: Authentication failed, it is either not correct, or expired, or does not have the correct permission -> github.com/Azure/azure-storage-file-go/azfile.newStorageError, /home/vsts/go/pkg/mod/github.com/!azure/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="70110a0502155d03041f021117155d16191c155d171f3006405e465e415d405e42404240414141414045434545495d431341474544141340401145" rel="noreferrer noopener nofollow">[email protected]</a>/azfile/zc_storage_error.go:42
===== RESPONSE ERROR (ServiceCode=CannotVerifyCopySource) =====
Description=Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

 RESPONSE Status: 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
 Content-Length: [322]
 Content-Type: [application/xml]
 Date: [Thu, 18 Aug 2022 13:34:12 GMT]
 Server: [Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0]
 X-Ms-Client-Request-Id: [****]
 X-Ms-Error-Code: [CannotVerifyCopySource]
 X-Ms-Request-Id: [****]
 X-Ms-Version: [2020-10-02]

我也尝试过以下命令,但也没有成功:

 az storage file copy start --source-uri "https://mystorageaccount.file.core.windows.net/x/mydir/myfile.dmp" --destination-path 'mydir' --destination-share y --account-name mystorageaccount --sas-token "?sv=2021-06-08&ss=f&srt=sco&sp=rwdlc&se=2022-08-18T15:00:27Z&st=2022-08-18T14:00:27Z&sip=myip&spr=https&sig=****"

如果有人可以提供帮助,我将不胜感激。

最佳答案

请尝试从您的 SAS token 中删除 IP 限制。

复制 blob 操作是服务器端复制,存储服务正在复制数据。

在 SAS token 中添加 IP 限制会阻止存储服务从源读取数据。

关于azure - 在同一 Azure 存储帐户下的两个 Azure 文件共享之间传输文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73404627/

相关文章:

stream - 在知道文件大小之前,如何增加 Azure 文件存储 CloudFile 的大小?

python - 无法在DataBricks中使用python成功分割JSON文件

Node.js Azure 文件服务 - 403 错误调试

c# - 使用 MS Word 更新文件时,Azure 存储文件共享会丢失元数据

c# - 在 ASP.NET 中使用文件 uploader 将图像上传到 Azure Blob?

azure - 如果 'foreach' 中的所有值均为 true

azure - 使用 Bicep 设置 Azure 存储帐户装载路径

python - 如何在Azure数据工厂自定义事件中加载python库?

azure - 找出导致 Application Insights Azure 响应时间较长的原因?

mongodb - Azure cosmosDB(mongoDB),如何在 GO lang 或通过 Shell 中禁用集合中的自动索引