简体   繁体   English

我们能否使用Azure CLI将文件上传到Azure Data Lake Storage Gen2

[英]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. 如果要上传文件,请参考以下两种解决方法。

  1. Use Azure Storage Explorer 使用Azure存储资源管理器

  2. 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.

相关问题 不能对 Azure Data Lake Gen2 文件使用通配符 - Can't use wildcard with Azure Data Lake Gen2 files Azure 数据湖存储 Gen2 权限 - Azure Data Lake storage Gen2 permissions 如何将 .parquet 文件从本地计算机上传到 Azure Storage Data Lake Gen2? - How can I upload a .parquet file from my local machine to Azure Storage Data Lake Gen2? 如何使用租户 ID、客户端 ID 和客户端机密连接和管理 Azure Data Lake Storage Gen2 中的目录和文件? - How can I use tenant id, client id and client secret to connect to and manage directories and files in Azure Data Lake Storage Gen2? Azure 的“Data Lake Storage Gen2”和“Data Lake Gen2”有什么区别? - What is the difference between Azure's "Data Lake Storage Gen2" and "Data Lake Gen2"? Microsoft Azure Data Lake 存储 (Gen2) 中的分层命名空间是什么? - What is hierarchical namespace in Microsoft Azure Data Lake storage (Gen2)? Azure Databricks:无法连接到 Azure Data Lake Storage Gen2 - Azure Databricks: can't connect to Azure Data Lake Storage Gen2 Azure Data Lake Gen2 与存储帐户 - Azure Data Lake Gen2 vs Storage account Azure Data Lake Storage Gen2 创建目录(如果 python 中不存在) - Azure Data Lake Storage Gen2 create directory if not exists in python 如何创建文件或将文件上传到Azure Data Lake Storage Gen2 - How to create a file or upload a file to Azure Data Lake Storage Gen2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM