java - ADLS Gen-2。从关于邮递员创建新文件系统的 PUT 请求中获取 AuthorizationPermissionMismatch 错误
问题描述
我通过这些 POST 请求登录到 adls gen 2:
https://login.microsoftonline.com//oauth2/v2.0/token
请求正文:
grant_type:client_credentials
client_id: my_client_id 来自 App 注册 -> 拥有的应用程序 -> Mu 应用程序
client_secret:来自应用注册的 my_client_secret -> 拥有的应用程序 -> 我的应用程序
范围:https ://storage.azure.com/.default
provider_type:org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider
并获得成功的响应码 200:
{
"token_type": "Bearer",
"expires_in": 3599,
"ext_expires_in": 3599,
"access_token": <token>
}
在我尝试使用以下 PUT 请求创建文件系统后: https ://dbmiadlsgen2.dfs.core.windows.net/mydata?resource=filesystem
标题:
授权 - Bearer Content-Type - text/plain x-ms-version - 2018-11-09
并得到以下错误:
{
"error": {
"code": "AuthorizationPermissionMismatch",
"message": "This request is not authorized to perform this operation using this permission.\nRequestId:bcb4c0d3-901f-00cc-0722-2b7f0c000000\nTime:2019-06-25T06:54:57.3437434Z"
}
}
我从 azure 门户对我的用户感到很高兴:存储 Blob 数据贡献者角色,但这无济于事......
你觉得我应该扮演什么样的角色?某些请求正文或标头参数是否不正确?谢谢你。
解决方案
将应用程序和帐户添加为所有者是不够的,我建议您前往您storage account > IAM > Add role and add the special permission
的此类请求,STORAGE BLOB DATA CONTRIBUTOR
.
如需进一步参考,请访问:
https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-app
希望能帮助到你。
推荐阅读
- .net-core - 无法访问 .net Core 3 中的 resx 文件
- javascript - 是否可以使用 Ramda 从数组中获取中间元素?
- frontend - GoogleCreativeContainerClass 来自哪里?
- transactions - 从密码学的角度需要有关付款如何工作(授权结算清算)的资源和建议
- java - AWS lambda/api 网关不重定向
- node.js - 猫鼬不查询
- facebook - 请求 user_friends
- reactjs - 使用 TypeScript 在 React 中导出颜色
- javascript - 计算最后一个工作页面以进行抓取的最快方法
- echarts - 图表。如何更新实时图表中的两个系列?