Search code examples
c#azuremicrosoft-graph-apiroles

Is it possible to create Azure RBAC role via Microsoft Graph


Is it possible to create Azure RBAC role via Microsoft Graph? (https://www.nuget.org/packages/Microsoft.Graph)

Basically, do what PowerShell's New-AzRoleDefinition does.


Solution

  • It is not possible to use Microsoft Graph API to create (or rather work with) Azure RBAC role.

    You would use Graph API to work with Azure AD whereas Azure RBAC roles are specific to Azure Subscription. You will need to use Azure REST API to work with Azure Subscription. To create an RBAC role, you will need to use Role Definitions - Create Or Update operation.