Microsoft Azure 中角色分配和 appRoleAssignments 之间的区别

问题描述

Microsoft Azure 中的角色分配和 appRoleAssignments 有什么区别?

https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-list-rest

https://docs.microsoft.com/en-us/graph/api/serviceprincipal-list-approleassignments?view=graph-rest-1.0&tabs=http

解决方法

主要区别在于 Role Assignments 是 Azure 订阅,而 App Role Assignments 是 Microsoft Graph API。

您使用 Role Assignments 将访问权限分配给 Azure AD 中的用户对 Azure 订阅中的各种资源。根据分配的角色,用户可以针对 Azure 订阅中的 Azure 资源执行活动。

App Role Assignments 实质上是将 Azure AD 中用户的访问权限分配给您为 Azure AD 应用程序创建的自定义角色。这些角色本质上是特定于您的应用程序的自定义角色(例如管理员、用户等),并在您的应用程序代码中用于限制对应用程序各个部分的访问,例如“管理员”应用角色的用户可以访问管理员屏幕,而“用户”应用角色的用户则不能。