question

Hishan-2429 avatar image
0 Votes"
Hishan-2429 asked Hishan-2429 commented

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

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-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered Hishan-2429 commented

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://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-powershell




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

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks very much mate. I managed to get this done.

0 Votes 0 ·
Hishan-2429 avatar image
0 Votes"
Hishan-2429 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.