PowerShell equivalent to the 'az role assignment create' ?

EnterpriseArchitect 6,041 Reputation points
2023-04-02T12:51:30.9233333+00:00

People,

How can I execute the PowerShell equivalent command for the below command?

az role assignment create \ 
--role 
Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
976 questions
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. TP 125.8K Reputation points Volunteer Moderator
    2023-04-02T12:55:28.5433333+00:00

    Hi,

    Sample:

    New-AzRoleAssignment `
    -RoleDefinitionId <GUID> `
    -ObjectId <GUID> `
    -Scope /subscriptions/<GUID>/resourceGroups/Resources
    

    Please see article below:

    Assign Azure roles using Azure PowerShell

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

    New-AzRoleAssignment

    https://learn.microsoft.com/en-us/powershell/module/az.resources/new-azroleassignment?view=azps-9.5.0

    Thanks.

    -TP


0 additional answers

Sort by: Most helpful

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.