简体   繁体   English

使用 AZCopy 将 AWS s3 存储桶复制到 Azure 存储时出错

[英]Error on copying AWS s3 bucket to Azure Storage using AZCopy

I have been trying to copy a AWS S3 bucket to my Azure Storage container following the Microsoft document Amazon S3 to Azure Storage by using AzCopy我一直在尝试使用 AzCopy将 AWS S3 存储桶复制到我的 Azure 存储容器

But the operation fails with error as below但操作失败,错误如下

failed to perform copy command due to error: cannot start job due to error: cannot list objects, Access Denied.由于错误无法执行复制命令:由于错误无法启动作业:无法列出对象,访问被拒绝。

I have tried to copy by authentication through both Azure AD and also SAS token with Full Access privileges (racwdl) but get same issue.我尝试通过 Azure AD 和具有完全访问权限 (racwdl) 的 SAS 令牌通过身份验证进行复制,但遇到了同样的问题。

I have verified that the AWS keys set are of admin access and also verified that both my AWS bucket and Azure Storage Containers are public.我已验证 AWS 密钥集具有管理员访问权限,还验证了我的 AWS 存储桶和 Azure 存储容器都是公开的。

What else could be wrong?还有什么可能是错的? Any inputs would be helpful.任何输入都会有所帮助。

Also sharing the terminal outputs on using AD authorization and SAS token authorization.还分享了使用 AD 授权和 SAS 令牌授权的终端输出。

On AD Authorization:关于广告授权:

INFO: Scanning... INFO: Authenticating to destination using Azure AD INFO: Instead of transferring from the 's3.amazonaws.com' URL, in this version of AzCopy we recommend you use a region-specific endpoint to transfer from one specific region.信息:正在扫描... 信息:正在使用 Azure AD 信息对目的地进行身份验证. Eg s3.us-east-1.amazonaws.com or a virtual-hosted reference to a single bucket.例如 s3.us-east-1.amazonaws.com 或对单个存储桶的虚拟托管引用。 INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support信息:将不会处理任何空文件夹,因为源和/或目标没有完整的文件夹支持

failed to perform copy command due to error: cannot start job due to error: cannot list objects, Access Denied.由于错误无法执行复制命令:由于错误无法启动作业:无法列出对象,访问被拒绝。

Using SAS Token Authorization使用 SAS 令牌授权

INFO: Scanning... INFO: Instead of transferring from the 's3.amazonaws.com' URL, in this version of AzCopy we recommend you use a region-specific endpoint to transfer from one specific region.信息:正在扫描... 信息:与其从“s3.amazonaws.com”URL 传输,在此版本的 AzCopy 中,我们建议您使用区域特定端点从一个特定区域传输。 Eg s3.us-east-1.amazonaws.com or a virtual-hosted reference to a single bucket.例如 s3.us-east-1.amazonaws.com 或对单个存储桶的虚拟托管引用。 INFO: Failed to create one or more destination container(s).信息:无法创建一个或多个目标容器。 Your transfers may still succeed if the container already exists.如果容器已经存在,您的传输可能仍会成功。 INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support信息:将不会处理任何空文件夹,因为源和/或目标没有完整的文件夹支持

failed to perform copy command due to error: cannot start job due to error: cannot list objects, Access Denied.由于错误无法执行复制命令:由于错误无法启动作业:无法列出对象,访问被拒绝。

I have managed to resolve this issue.我已经设法解决了这个问题。 Apparently the solution is to add the AWS credentials as environment variables as setting them on CLI as mentioned in the documents doesn't work.显然,解决方案是将 AWS 凭证添加为环境变量,因为文档中提到的在 CLI 上设置它们不起作用。

As stated above, the powershell script "set AWS_ACCESS_KEY_ID=....." doesn't work as it doesn't add the system environment variables in windows, so the access is denied to S3.如上所述,powershell 脚本“set AWS_ACCESS_KEY_ID=.....”不起作用,因为它没有在 windows 中添加系统环境变量,因此拒绝访问 S3。 To add the environment variables in Windows do the following:要在 Windows 中添加环境变量,请执行以下操作:

  1. Press Windows Key + R then open "control sysdm.cpl"按 Windows 键 + R 然后打开“control sysdm.cpl”
  2. In System Properties click on Advanced -> Environment Variables在系统属性中点击高级 -> 环境变量
  3. Under System Variables add the variable name: AWS_ACCESS_KEY_ID and place your access key under the value.在系统变量下添加变量名称:AWS_ACCESS_KEY_ID 并将您的访问密钥放在该值下。
  4. Add another system variable "AWS_SECRET_ACCESS_KEY" and place in the AWS secret key.添加另一个系统变量“AWS_SECRET_ACCESS_KEY”并放入 AWS 密钥中。
  5. Go back to powershell and you should be able to run azcopy and the permissions should work. Go 变回 powershell,您应该能够运行 azcopy 并且权限应该有效。
  6. If the permissions still do not work, then it might be an issue with the permissions in AWS.如果权限仍然不起作用,则可能是 AWS 中的权限问题。

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

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