如何使用hadoop sdk和azure msi身份验证访问blob存储

ssm49v7z  于 2021-05-27  发布在  Hadoop
关注(0)|答案(0)|浏览(315)

我试着用 org.apache.hadoop.fs.FileSystem.get(Config...); 获取azure存储的方法。
对于azure data lake gen2,我使用的uri如下:

abfs://mydlfilesystem@mydlaccount.dfs.core.windows.net/my_path

并设置属性:

fs.defaultFS = "abfs://mydlfilesystem@mydlaccount.dfs.core.windows.net/my_path"
   fs.adl.oauth2.access.token.provider.type = "ClientCredential"
   fs.azure.ssl.channel.mode = Default_JSSE"
   fs.azure.account.oauth.provider.type = "org.apache.hadoop.fs.azurebfs.oauth2.MsiTokenProvider"
   fs.azure.account.auth.type = "OAuth"
   fs.azure.account.oauth2.msi.tenant = "MyTenantId"
   fs.azure.account.oauth2.client.id = "MyClientId"

它确实工作正常。
但如果我尝试访问azure blob存储。我使用的uri如下:

wasb://mycont@mybsaccount.dfs.core.windows.net/my_path

和相同的配置属性。我有: org.apache.hadoop.fs.azure.AzureException: No credentials found for account mycont@mybsaccount.dfs.core.windows.net in the configuration, and its container mycont is not accessible using anonymous credentials. Please check if the container exists first. If it is not publicly available, you have to provide account credentials. 我想知道如何通过hadoopsdk使用msi身份验证访问blob存储。
谢谢,塞吉

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题