Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (13.1k points)
Can anyone help me how I can able to set the RBAC rules to owner so that I can able to access the resource inside the subscription?

1 Answer

0 votes
by (26.7k points)
edited by

You can use PowerShell to grant a user with a role of "Owner". Below is the command to do that:

#create user

Connect-AzureAD

$PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile

$PasswordProfile.Password = "Wdsr199545!"

New-AzureADUser -DisplayName "test User" -PasswordProfile $PasswordProfile -UserPrincipalName "[email protected]" -AccountEnabled $true -MailNickName "testuser"

#grant access 

Login-AzureRmAccount

$sub = Get-AzureRmSubscription

$scope = "/subscriptions/" + $sub.Id

New-AzureRmRoleAssignment -SignInName [email protected] -Scope $scope -RoleDefinitionName Owner

I hope this will help.

Want to become an Azure expert? join azure architect certification now!!

Want to know more about Azure Active Directory? Watch this video on Azure Active Directory | Microsoft Azure Tutorial for Beginners:

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...