[英]Can we use Azure CLI to upload files to Azure Data Lake Storage Gen2
All I want to do, is to upload files from on prime to Azure Data Lake Storage Gen2 using the Azure CLI (via ` command), but have a connection error! 我要做的就是使用Azure CLI(通过`命令)将文件从原始文件上传到Azure Data Lake Storage Gen2 ,但是出现连接错误! Can I use Azure CLI to to that?
我可以使用Azure CLI来做到这一点吗? Or I have to use another tool?
还是我必须使用其他工具? PS: I cannot use Azure Data Factory, I want my job running from my on prime and not from the cloud!
PS:我无法使用Azure数据工厂,我希望我的工作从最初开始而不是从云开始! Thks.
ks
azure.datalake.store.exceptions.DatalakeRESTException: HTTP error:
ConnectionError(MaxRetryError("HTTPSConnectionPool(host='storageAccount.azuredatalakestore.net', port=443):
Max retries exceeded with url: /webhdfs/v1/my-file-system/data.csv?OP=GETFILESTATUS&api-version=2018-05-01
(Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc7ed169c50>:
Failed to establish a new connection: [Errno -2] Name or service not known')
No, Azure CLI for gen2 filesystem is not available, see this link . 否,第2代文件系统的Azure CLI不可用,请参阅此链接 。
If you want to upload file, here are two workarounds for you to refer. 如果要上传文件,请参考以下两种解决方法。
Use AzCopy v10 , note only v10 supports Azure Data Lake Storage Gen2 APIs. 使用AzCopy v10 ,请注意,只有v10支持Azure Data Lake Storage Gen2 API。 Use
myaccount.dfs.core.windows.net
as a URI to call the ADLS Gen2 APIs. 使用
myaccount.dfs.core.windows.net
作为URI来调用ADLS Gen2 API。
Got it work ^^ So the problem was with my authentication method, to make it work, you have to add your user as a Data Lake Storage Contributor + Owner. 它能正常工作^^因此,问题出在我的身份验证方法上,要使其起作用,您必须将用户添加为Data Lake Storage Contributor + Owner。 For anyone looking for the Role in the UI it's called "Storage Blob Data Contributor (Preview)".
对于在UI中寻找角色的任何人,它都称为“存储Blob数据贡献者(预览)”。 For a Resource Group choose Access Control (IAM) |
对于资源组,选择“ 访问控制(IAM)” |“访问控制”。 Add in the blade locate the role Storage Blob Data Contributor (Preview) and assign access to the Users, Groups or Roles as meets your needs.
在刀片中添加角色Storage Blob Data Contributor(预览),并根据需要分配对用户,组或角色的访问权限。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.