【Azure API 管理】 为APIM创建一个审批订阅申请的RBAC角色,最少的Action内容是什么呢?

问题描述

在使用APIM服务中,需要为专门的一组用户赋予特殊的权限:审批APIM用户的对产品的订阅。需要自定义一个RBAC角色,那么如何来设置最少的Action满足需求呢?

 

问题解答

要对APIM订阅进行审批,至少需要 Microsoft.ApiManagement/service/subscriptions/write (对subscriptions的write权限)。同时,也需要有APIM资源,当前资源组,Subscriptions的Read权限。所以总起来就是需要以下Actions:

  1. Microsoft.ApiManagement/service/subscriptions/write
  2. Microsoft.ApiManagement/service/subscriptions/read
  3. Microsoft.Resources/subscriptions/resourceGroups/read
  4. Microsoft.ApiManagement/service/read

当需要在Azure门户上创建自定义RBAC 角色时候,自定义JSON内容为:

复制代码
{
    "properties": {
        "roleName": "APIM Only Approval Subscription User",
        "description": "APIM Only Approval Subscription User",
        "assignableScopes": [
            "/subscriptions/<your azure subscription ID>"
        ],
        "permissions": [
            {
                "actions": [
                    "Microsoft.ApiManagement/service/subscriptions/write",
                    "Microsoft.ApiManagement/service/subscriptions/read",
                    "Microsoft.Resources/subscriptions/resourceGroups/read",
                    "Microsoft.ApiManagement/service/read"
                ],
                "notActions": [],
                "dataActions": [],
                "notDataActions": []
            }
        ]
    }
}
复制代码

创建成功后,效果如下:

 

参考资料

使用 Azure 门户创建 Azure 自定义角色 : https://docs.microsoft.com/zh-cn/azure/role-based-access-control/custom-roles-portal

 

posted @   路边两盏灯  阅读(58)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-05-31 【Azure 事件中心】azure-spring-cloud-stream-binder-eventhubs客户端组件问题, 实践消息非顺序可达
点击右上角即可分享
微信分享提示