AZ‐500 Microsoft Azure Security Technologies Study Guide_30 - itnett/FTD02H-N GitHub Wiki
🔐 Role-Based Access Control (RBAC) Lab
In this lab, you will practice using Role-Based Access Control (RBAC) to manage access to Azure resources. You will:
- ✅ Create Azure users and groups.
- ✅ Assign roles to groups using RBAC.
- ✅ Verify the assignments.
This lab provides you with essential hands-on experience for mastering RBAC, a key concept in the AZ-500 certification exam.
🧑🏫 Lab Scenario
Your organization has requested a proof of concept demonstrating how to create users and groups in Azure, and how to use Role-Based Access Control (RBAC) to manage access by assigning roles to these groups. Specifically, you will:
- Create a System Admins group containing the user account of Alex Johnson.
- Create a Support Engineers group containing the user account of Mia Patel.
- Create a Help Desk group containing the user account of Ethan Lee.
- Assign the Virtual Machine Contributor role to the Help Desk group.
All resources will be deployed in the East US region.
🎯 Lab Objectives
You will complete the following exercises:
- Exercise 1: Create the System Admins group with the user Alex Johnson as its member (using the Azure Portal).
- Exercise 2: Create the Support Engineers group with the user Mia Patel as its member (using PowerShell).
- Exercise 3: Create the Help Desk group with the user Ethan Lee as its member (using Azure CLI).
- Exercise 4: Assign the Virtual Machine Contributor role to the Help Desk group.
📝 Exercise 1: Create the System Admins Group (Azure Portal)
Task 1: Create a user account for Alex Johnson
- 🔑 Log in to the Azure Portal.
- In the Search bar, type Microsoft Entra ID and press Enter.
- On the Microsoft Entra ID page, go to Users, then click + New user.
- Fill in the following details for the new user:
- User name: Alex
- Name: Alex Johnson
- Auto-generate password: Enabled
- Ensure Show password is selected, and note down the password.
- Click Create.
- Verify that Alex Johnson's account was successfully created by refreshing the Users page.
Task 2: Create the System Admins group and add Alex Johnson
- Navigate back to the Microsoft Entra ID page.
- Select Groups from the left-hand menu and click + New group.
- Fill in the group details:
- Group type: Security
- Group name: System Admins
- Membership type: Assigned
- Add Alex Johnson as a member of the group:
- Click No members selected, search for Alex Johnson, and click Select.
- Click Create to finalize the group.
📝 Exercise 2: Create the Support Engineers Group (PowerShell)
Task 1: Create a user account for Mia Patel
-
Open Cloud Shell in the Azure portal, ensuring PowerShell is selected.
-
Create a password profile object for Mia Patel by running the following command:
$passwordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
-
Set the password in the profile:
$passwordProfile.Password = "P@ssw0rd123!"
-
Connect to Microsoft Entra ID (formerly Azure AD):
Connect-AzureAD
-
Create a user account for Mia Patel:
New-AzureADUser -DisplayName "Mia Patel" -PasswordProfile $passwordProfile -UserPrincipalName "[email protected]" -AccountEnabled $true -MailNickName "Mia"
-
Verify the user account has been created by listing all users:
Get-AzureADUser -All $true | Where-Object {$_.UserPrincipalName -like "*@yourdomain.com*"}
Task 2: Create the Support Engineers group and add Mia Patel
-
In the same PowerShell session, create a new security group for Support Engineers:
New-AzureADGroup -DisplayName "Support Engineers" -MailEnabled $false -SecurityEnabled $true -MailNickName SupportEngineers
-
Add Mia Patel to the group:
$user = Get-AzureADUser -Filter "UserPrincipalName eq '[email protected]'" Add-AzureADGroupMember -ObjectId (Get-AzureADGroup -Filter "DisplayName eq 'Support Engineers'").ObjectId -RefObjectId $user.ObjectId
📝 Exercise 3: Create the Help Desk Group (Azure CLI)
Task 1: Create a user account for Ethan Lee
-
Open Cloud Shell in the Azure portal, this time selecting Bash.
-
Run the following command to create a user for Ethan Lee:
az ad user create --display-name "Ethan Lee" --password "P@ssw0rd123!" --user-principal-name [email protected]
-
Verify the user creation:
az ad user list --output table
Task 2: Create the Help Desk group and add Ethan Lee
-
Create the Help Desk group:
az ad group create --display-name "Help Desk" --mail-nickname "HelpDesk"
-
Add Ethan Lee to the group:
USER_ID=$(az ad user show --id "[email protected]" --query objectId -o tsv) az ad group member add --group "Help Desk" --member-id $USER_ID
📝 Exercise 4: Assign Virtual Machine Contributor Role to Help Desk Group
Task 1: Create a resource group
- In the Azure Portal, type Resource groups in the search bar and click + Create.
- Fill in the details:
- Resource group name: AzureLabRG
- Region: East US
- Click Review + Create, and then Create.
Task 2: Assign the role
- Go to the Resource groups page and select AzureLabRG.
- In the left-hand menu, click Access Control (IAM), then click + Add > Add role assignment.
- Select the Virtual Machine Contributor role.
- Under Assign access to, choose User, group, or service principal.
- In the Select members section, search for Help Desk, and click Review + Assign.
🧹 Clean-Up: Removing Resources
To avoid unnecessary costs, remove any Azure resources you created:
-
Open the Cloud Shell.
-
Run the following to remove the resource group:
Remove-AzResourceGroup -Name "AzureLabRG" -Force -AsJob
🎉 Congratulations!
You have successfully completed the lab. You now know how to create users and groups in Azure, assign roles using Role-Based Access Control, and verify permissions.
This Markdown can be used for your GitHub Wiki to guide others through a hands-on Role-Based Access Control (RBAC) lab, ensuring a unique, engaging, and practical learning experience.