Hands-On Lab: Secure Guest (B2B) Access on Azure AD via Azure Portal
Overview
This lab provides a hands-on exercise to configure secure Business-to-Business (B2B) collaboration in Microsoft Azure using Azure Active Directory (Azure AD). You will configure guest access settings, invite an external user, assign resource access, and enforce conditional access policies.
Objectives
- Configure Azure AD for external guest collaboration.
- Invite a guest user securely.
- Assign RBAC roles to guest users.
- Enforce Conditional Access policies.
- Validate guest access from an external user’s perspective.
Prerequisites
- Azure subscription with Owner or User Administrator privileges.
- Admin access to Azure Active Directory.
- A personal email address (Gmail, Outlook, etc.) for testing guest access.
- Incognito/private browser for testing guest access.
1. Configure External Collaboration Settings
-
Go to:
Azure Portal→Azure Active Directory→External Identities→External collaboration settings - Set the following:
- Guest user access:
Guest users have limited access to properties and memberships of directory objects - Guest invite settings:
Admins and users in the guest inviter role can invite - Enable Email One-Time Passcode:
Yes - Restrict guest access to directory:
Yes
- Guest user access:
- Click Save.
2. Invite a Guest User
-
Navigate to:
Azure Active Directory→Users→+ New guest user - Choose
Invite user, then enter:- Name:
Test Guest - Email:
<use your personal email> - Personal message (optional)
- Name:
-
(Optional) Add the guest to a new group (e.g.,
B2B-Test-Group) - Click Invite
The user will receive an email invitation.
3. Assign Role to Guest User on a Resource Group
-
Go to:
Resource Groups→ Create or select a resource group (e.g.,test-b2b-rg) -
Navigate to:
Access Control (IAM)→+ Add→Add role assignment - In the Role Assignment:
- Role:
Reader - Assign access to:
User, group, or service principal - Select: The invited guest user
- Role:
- Click Save
This gives read-only access to the selected resource group.
4. Enforce Conditional Access for Guest Users
-
Navigate to:
Azure AD→Security→Conditional Access→+ New policy - Configure the policy:
- Name:
Require MFA for Guests - Users: Select
Guest or external users - Cloud apps:
All cloud appsor specific apps - Grant Controls:
- Grant access
- Require multi-factor authentication
- Name:
- Enable the policy and click Create
This ensures external users authenticate securely.
5. Validate Guest Access
-
Open an incognito/private browser window
-
Access the invitation link sent to your guest email
-
Accept the invitation and sign in
-
Navigate to:
https://portal.azure.com/ -
Locate the Resource Group you were assigned to
You should be able to view the resource group but not modify or delete anything.
6. (Optional) Audit and Governance
- Check
Azure AD→Sign-in logsfor guest activity - Set up
Access ReviewsunderIdentity Governanceto periodically review guest access - Customize branding under
Company Brandingfor guest sign-in experience
Cleanup (Optional)
- Remove the guest user from Azure AD
- Delete the resource group or remove access
- Disable or delete the Conditional Access policy
Next Steps
- Automate guest setup with PowerShell or Terraform
- Test custom roles for more granular control
- Integrate with Microsoft Entra ID for advanced identity governance