Azure Blob存储“授权许可不匹配"使用AD令牌获取请求时出错 [英] Azure Blob Storage "Authorization Permission Mismatch" error for get request with AD token
问题描述
我正在构建一个Angular 6应用程序,该应用程序将能够在Azure Blob存储上进行CRUD操作.但是,我正在使用邮递员来测试请求,然后再在应用程序内部实现请求,并将我从Angular获得的令牌复制粘贴到该资源中.
I am building an Angular 6 application that will be able to make CRUD operation on Azure Blob Storage. I'm however using postman to test requests before implementing them inside the app and copy-pasting the token that I get from Angular for that resource.
当尝试读取存储在存储中的文件以进行测试时,我得到:<Code>AuthorizationPermissionMismatch</Code>
<Message>This request is not authorized to perform this operation using this permission.
When trying to read a file that I have inside the storage for test purposes, I'm getting: <Code>AuthorizationPermissionMismatch</Code>
<Message>This request is not authorized to perform this operation using this permission.
- 所有在生产环境中(尽管正在开发中)
- 通过Oauth专门为存储资源获取的令牌
- 邮递员将令牌策略称为"bearer"(承载者)
- 应用程序已授予"Azure存储"委派权限.
- 应用程序和我要获取令牌的帐户都被添加为所有者"在蔚蓝的访问控制IAM中
- 我的IP已添加到Blob存储上的CORS设置中.
- StorageV2(通用v2)-标准-热门 使用的
- x-ms-version标头是:
2018-03-28
,因为这是我可以找到的最新版本,并且我刚刚创建了存储帐户.
- All in production environment (although developing)
- Token acquired specifically for storage resource via Oauth
- Postman has the token strategy as "bearer "
- Application has "Azure Storage" delegated permissions granted.
- Both the app and the account I'm acquiring the token are added as "owners" in azure access control IAM
- My IP is added to CORS settings on the blob storage.
- StorageV2 (general purpose v2) - Standard - Hot
- x-ms-version header used is:
2018-03-28
because that's the latest I could find and I just created the storage account.
推荐答案
我发现不足以将应用程序和帐户添加为所有者,我进入您的存储帐户> IAM>添加角色并添加特殊权限对于这种类型的请求,STORAGE BLOB DATA CONTRIBUTOR(PREVIEW)
I found it's not enough for the app and account to be added as owners, I would go into your storage account > IAM > Add role and add the special permission for this type of request, STORAGE BLOB DATA CONTRIBUTOR (PREVIEW)
这篇关于Azure Blob存储“授权许可不匹配"使用AD令牌获取请求时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!