Skip to content

Lab 01: Know your access, from scope to Activity log

At a glance

  • Time: about 30 minutes
  • Region: none, you don't create resources in this lab
  • You create: nothing
  • Clean up: nothing to clean up

What you will learn

  • Where a resource group sits: tenant, subscription, resource group, resources.
  • How Azure role-based access control (RBAC) gives you access: a role, given to a group, at a scope.
  • How to read what a role allows, and what happens when you try something it doesn't allow.
  • Where to find the record of what happened in your group (the Activity log).

What is different in this environment

Creating management groups, custom roles and role assignments needs permissions that students don't have here, so your trainer demonstrates them. In this lab you explore the access you have, which is set up the same way.

Diagram: your resource group sits inside the subscription and the lab directory. Your Entra group CLOUD-LAB-GRP-N gets the role Lab Student at the scope of your resource group, which makes a role assignment.
Where your resource group sits, and how a role assignment gives your group access to it. Select the diagram to open it full size.

Before you start

  • You are signed in to the lab directory (Getting started).
  • You know your group number N.

Task 1: Find your place in Azure

  1. In the portal, search for and select Resource groups.
  2. Select your group, rg-CLOUD-LAB-GRP-N.
  3. On the Overview page, note:
    • the Subscription it belongs to,
    • its Location,
    • the Tags (if any).
  4. Select JSON View (top right of the Essentials section) and find the Resource ID. It shows the full path: /subscriptions/<id>/resourceGroups/rg-CLOUD-LAB-GRP-N.

Think about it

The resource ID is also the scope used by RBAC and Azure Policy. Anything given at this scope applies to every resource inside the group.

Task 2: See who has access

  1. In your resource group, select Access control (IAM).
  2. Select View my access. You should see the roles you get through your group:

    Role What it gives you
    Lab Student Create and manage the allowed lab resources in this group
    Lab Student IAM Delegate Give two storage data roles to your own group only (it has a condition)
  3. Close the pane and select the Role assignments tab.

  4. Find the CLOUD-LAB-GRP-N group. Note:
    • the Role,
    • the Scope: This resource (the resource group),
    • the Condition column for the IAM Delegate role.
  5. Look for other assignments in the list, such as the role used by the lab's automatic limit enforcer. Note that you can see them, but you can't change them.

Why a group?

Access is given to your group, not to you as a person. Adding or removing a member changes access without touching the role assignments. This is the recommended way to manage access in Azure.

Task 3: Read what a role allows

  1. Still in Access control (IAM), select the Roles tab.
  2. Search for Lab Student and select View in its row.
  3. On the Permissions tab, browse the list. Then select JSON and find:
    • actions: what the role allows, for example Microsoft.Compute/virtualMachines/*.
    • notActions: what is taken away again, for example Microsoft.Authorization/*/write.
    • assignableScopes: where the role can be given. It lists the lab resource groups only, not the subscription.
  4. Compare it with a built-in role: search for Reader and Contributor and view their JSON.

Think about it

  • Which line stops you from changing access (IAM)?
  • Which line stops you from creating or deleting resource groups?
  • Why is */read in the list?

Task 4: Try something the role doesn't allow

You'll try two actions that the role blocks, and look at the error.

  1. Add a tag to your resource group: on the Overview page of your group, select Tags (edit), add owner = your name, and select Apply.
  2. Create a resource group: go to Resource groups, select + Create, enter rg-test-N in Southeast Asia, then Review + create and Create.

Both should fail with an error that says you don't have authorization (AuthorizationFailed). For the resource group, the portal may stop you earlier, for example by not offering the subscription or by failing validation. That is the same restriction. Read the message: it names the action that was refused, for example Microsoft.Resources/subscriptions/resourceGroups/write.

Not a guardrail code

These errors don't start with [LAB-...]. They come from RBAC (your role), not from Azure Policy. Lab 02 covers Azure Policy.

Task 5: Check the Activity log

  1. In your resource group, select Activity log.
  2. Set Timespan to Last hour.
  3. Find your attempts from Task 4 and select one. The tag attempt is the most likely to be there; an attempt the portal stopped before sending isn't logged. Note the Status (Failed), the Event initiated by (you), and the Operation name.
  4. Select JSON and find the error message.

Tip

The Activity log is where you, and your trainer, can see who did what in a resource group. It keeps events for 90 days.

Check your work

  • You can name the subscription and location of your resource group.
  • You found the two roles your group has on your resource group.
  • You can explain the difference between actions and notActions.
  • You saw an AuthorizationFailed error and found it in the Activity log.

Key points

  • RBAC access = who (security principal) + what (role definition) + where (scope).
  • Give roles to groups, at the smallest scope that works.
  • A role assignment can have a condition that narrows it further.
  • RBAC errors say AuthorizationFailed. Azure Policy errors in this lab start with [LAB-...].
  • The Activity log records every change, including failed attempts.