empty job function roles, and conditions for owner

P, John 240 Reputation points
2024-02-06T21:12:39.1+00:00

As the owner of a resource group, I want to add the billing reader role for another user in my group. When I tried to do it in the portal, I got the empty list of the job function roles. I download the role assignment of the resource group and see there are 2 conditions for my owner role (replace the guid with xxx): ((!(ActionMatches{'Microsoft.Authorization/roleAssignments/write'})) OR (@Request[Microsoft.Authorization/roleAssignments:RoleDefinitionId] ForAnyOfAnyValues:GuidEquals {xxx})) AND ((!(ActionMatches{'Microsoft.Authorization/roleAssignments/delete'})) OR (@Resource[Microsoft.Authorization/roleAssignments:RoleDefinitionId] ForAnyOfAnyValues:GuidEquals {xxx})) Do these conditions add or remove my owner capability to assign role for other user in my team?

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Accepted answer
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2024-02-08T00:30:34.2866667+00:00

    @Pan, John ,

    You can only assign the Billing Reader role at the subscription or management group scope and not at the Resource Group level. If you have the correct Owner role at the subscription level, you can assign the RBAC roles.

    The "write" and "delete" permissions allow you to assign Azure RBAC roles. The conditions for your owner role validate that the action matches 'Microsoft.Authorization/roleAssignments/write' and the role definition ID matches the specified GUID. If this condition is not met, then the second condition checks if the action matches 'Microsoft.Authorization/roleAssignments/delete' and the role definition ID matches the specified GUID. (reference for RBAC role assignment) To assign the Billing Reader role, you need to have the Owner, User Access Administrator, Service Administrator or Co-administrator role on the subscription itself and not just the Resource Group. https://azure.microsoft.com/en-us/blog/azure-billing-reader-role-and-preview-of-invoice-api/#:~:text=How%20to%20add%20users%20to%20Billing%20Reader%20Role,to%20delegate%20access%20to%20subscription%20scoped%20billing%20information

    If you have the right permissions and want to assign the role at the subscription or management group scope, you can do so via Azure CLI:

    At Management Group scope:

    az role assignment create --assignee "alain@example.com" \ --role "Billing Reader" \ --scope "/providers/Microsoft.Management/managementGroups/marketing-group"
    

    At subscription scope:

    az role assignment create --assignee <user-email> --role "Billing Reader" --scope /subscriptions/<subscription-id[2](#doc-pos=0)</span>>
    

    If you want this user to see some of the billing info and not others, you may want to create a custom RBAC role via AzureRM with some of the permissions set into the NotActions Section. Currently "Billing Reader" is set up with the following permissions:

    Get-AzureRmRoleDefinition "Billing Reader"
    Name             : Billing Reader
    Id               : fa23ad8b-c56e-40d8-ac0c-ce449e1d2c64
    IsCustom         : False
    Description      : Allows read access to billing data
    Actions          : {Microsoft.Authorization//read, Microsoft.Billing//read, Microsoft.Commerce//read,
                       Microsoft.Consumption/
    /read...}

    NotActions       : {}
    DataActions      : {}
    NotDataActions   : {}
    AssignableScopes : $billing = (Get-AzureRmRoleDefinition "Billing Reader")
    $billing.Actions
    Microsoft.Authorization//read
    Microsoft.Billing/
    /read
    Microsoft.Commerce//read
    Microsoft.Consumption/
    /read
    Microsoft.Management/managementGroups/read
    Microsoft.CostManagement//read
    Microsoft.Support/

    Let me know if this helps, if I understood your request correctly, and if you run into any issues.

    If the information helped you, please Accept the answer. This will help us as well as others in the community who may be researching similar questions.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. P, John 240 Reputation points
    2024-02-09T22:32:09.7633333+00:00

    Got it, role assignment works only on the scope of subscription and managed group. Thanks for detailed explanation

    0 comments No comments

  2. Mahmoud A. ATALLAH 226 Reputation points MVP
    2024-02-28T05:12:18.15+00:00

    Check that you're currently signed in with a user that is assigned a role that has the Microsoft.Authorization/roleAssignments/write permission such as Role Based Access Control Administrator at the scope you're trying to assign the role Or Assign Owner role, However, this is not a best practice as security principals

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.