How to assign Owner role of an Azure subscription to a particular user group (Azure AD Synced Group) using PowerShell

Hishan 71 Reputation points
2022-05-03T13:09:28.883+00:00

Hello Everyone,

This is very simple if you do it from Azure portal and infact I found an article from Microsoft explaining exactly how to do it.

Assign a user as an administrator of an Azure subscription

However I am struggling to write up a code to assign the Owner role of a particular subscription to an Azure AD Synced group. How do I do it using PowerShell?

Many thanks in advance.

Hishan

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 39,931 Reputation points
    2022-05-04T07:46:36.973+00:00

    Hi Hishan-2429,

    This process should be pretty simple using Azure PowerShell commands such as:

    New-AzRoleAssignment -ObjectId <objectId> \-RoleDefinitionName <roleName>
    -Scope /subscriptions/<subscriptionId>/resourcegroups/<resourceGroupName>/providers/<providerName>/<resourceType>/<resourceSubType>/<resourceName>

    Here's a guide from Microsoft:

    https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-powershell

    --------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--


1 additional answer

Sort by: Most helpful
  1. Hishan 71 Reputation points
    2022-05-04T05:51:25.887+00:00
    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.