【Azure API 管理】 為APIM創(chuàng)建一個審批訂閱申請的RBAC角色,最少的Action內(nèi)容是什么呢?

問題描述

在使用APIM服務(wù)中,需要為專門的一組用戶賦予特殊的權(quán)限:審批APIM用戶的對產(chǎn)品的訂閱。需要自定義一個RBAC角色,那么如何來設(shè)置最少的Action滿足需求呢?


image.png

問題解答

要對APIM訂閱進行審批,至少需要 Microsoft.ApiManagement/service/subscriptions/write (對subscriptions的write權(quán)限)。同時,也需要有APIM資源,當(dāng)前資源組,Subscriptions的Read權(quán)限。所以總起來就是需要以下Actions:

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

當(dāng)需要在Azure門戶上創(chuàng)建自定義RBAC 角色時候,自定義JSON內(nèi)容為:

{
    "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": []
            }
        ]
    }
}

創(chuàng)建成功后,效果如下:


image.png

參考資料

使用 Azure 門戶創(chuàng)建 Azure 自定義角色 : https://docs.microsoft.com/zh-cn/azure/role-based-access-control/custom-roles-portal

當(dāng)在復(fù)雜的環(huán)境中面臨問題,格物之道需:濁而靜之徐清,安以動之徐生。 云中,恰是如此!

分類: 【Azure API 管理】

標(biāo)簽: APIM, 設(shè)置自定義RBAC角色, Microsoft.ApiManagement/service/, subscriptions/write

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容