A custom role definition is a set of permissions that you create to control access to Azure resources. It lets you specify exactly what actions users can perform.
Click to reveal answer
beginner
Which JSON property defines the actions allowed in a custom role?
The actions property lists the operations that are allowed by the role, such as reading or writing resources.
Click to reveal answer
intermediate
Why use custom roles instead of built-in roles in Azure?
Custom roles let you tailor permissions to your exact needs, avoiding giving too many or too few rights compared to built-in roles.
Click to reveal answer
intermediate
What is the purpose of the notActions property in a custom role definition?
The notActions property lists actions that are excluded from the allowed actions. It helps refine permissions by denying specific operations.
Click to reveal answer
beginner
How do you assign a custom role to a user in Azure?
You assign a custom role by creating a role assignment that links the role definition to a user, group, or service principal at a specific scope.
Click to reveal answer
What JSON property specifies the scope of a custom role definition?
AroleScope
Bscope
CassignableScopes
DresourceScope
✗ Incorrect
The assignableScopes property defines where the custom role can be assigned, such as a subscription or resource group.
Which property in a custom role definition contains the role's unique identifier?
AroleName
BroleId
Cname
Did
✗ Incorrect
The id property holds the unique identifier (GUID) for the role definition.
What is the minimum required property to create a valid custom role definition?
Aactions
BassignableScopes
CroleName
Ddescription
✗ Incorrect
The assignableScopes property is required to specify where the role can be assigned.
Which of these is NOT a valid action in a custom role definition?
AMicrosoft.FakeService/fakeAction
BMicrosoft.Compute/virtualMachines/start/action
CMicrosoft.Network/virtualNetworks/delete
DMicrosoft.Storage/storageAccounts/read
✗ Incorrect
Actions must be valid Azure resource provider operations. "Microsoft.FakeService/fakeAction" is not a real Azure action.
How can you prevent a custom role from allowing a specific action?
AAdd it to notActions
BAdd it to assignableScopes
CRemove it from actions
DSet it in description
✗ Incorrect
The notActions property excludes specific actions from the allowed actions.
Explain the key components of an Azure custom role definition JSON and their purposes.
Think about what permissions are allowed, denied, and where the role applies.
You got /5 concepts.
Describe the process to create and assign a custom role in Azure.
Consider the steps from writing the role to giving it to someone.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of creating a custom role definition in Azure?
easy
A. To tailor permissions exactly to specific needs
B. To delete all existing roles in Azure
C. To automatically assign roles to all users
D. To create virtual machines quickly
Solution
Step 1: Understand role customization
Custom roles allow you to specify exactly which permissions are granted or denied, unlike built-in roles which are fixed.
Step 2: Identify the purpose of custom roles
They help tailor permissions to fit specific needs, improving security and control.
Final Answer:
To tailor permissions exactly to specific needs -> Option A
Quick Check:
Custom roles = tailored permissions [OK]
Hint: Custom roles = tailor permissions to your needs [OK]
Common Mistakes:
Thinking custom roles delete existing roles
Assuming custom roles auto-assign to all users
Confusing custom roles with VM creation
2. Which JSON property is required to specify the permissions allowed in a custom role definition?
easy
A. "NotActions"
B. "Actions"
C. "allowedActions"
D. "permissions"
Solution
Step 1: Review custom role JSON structure
The property "Actions" lists the allowed operations in the role definition.
Step 2: Differentiate from other properties
"NotActions" lists denied permissions, "permissions" is a container but not the direct property, and "allowedActions" is not a valid property.
Final Answer:
"Actions" -> Option B
Quick Check:
Allowed permissions = "Actions" [OK]
Hint: Allowed permissions are under "Actions" in JSON [OK]
The action "Microsoft.Storage/storageAccounts/read" grants read-only access to storage accounts.
Step 2: Check "NotActions" property
It is empty, so no permissions are excluded.
Final Answer:
Read access to storage accounts -> Option D
Quick Check:
Action includes "read" = read access [OK]
Hint: Look for "read" in actions for read-only permission [OK]
Common Mistakes:
Assuming full control from read action
Confusing read with write permissions
Ignoring empty NotActions meaning no exclusions
4. You created a custom role but users report they cannot perform allowed actions. Which is the most likely error in the role definition?
medium
A. Role description is missing
B. "Actions" property is missing or empty
C. "NotActions" includes the same actions as "Actions"
D. Role name is too long
Solution
Step 1: Understand "NotActions" effect
"NotActions" excludes permissions even if listed in "Actions".
Step 2: Identify conflict in permissions
If "NotActions" includes the same actions as "Actions", those permissions are denied, causing users to lack access.
Final Answer:
"NotActions" includes the same actions as "Actions" -> Option C
Quick Check:
Conflicting "NotActions" denies permissions [OK]
Hint: "NotActions" overrides "Actions" if overlapping [OK]
Common Mistakes:
Ignoring "NotActions" effect
Thinking role name or description affects permissions
Assuming missing "Actions" is common
5. You want to create a custom role that allows users to start and stop virtual machines but denies deleting them. Which JSON snippet correctly defines this?
hard
A. { "Actions": ["Microsoft.Compute/virtualMachines/*"], "NotActions": ["Microsoft.Compute/virtualMachines/delete"] }
B. { "Actions": ["Microsoft.Compute/virtualMachines/start"], "NotActions": ["Microsoft.Compute/virtualMachines/delete"] }
C. { "Actions": ["Microsoft.Compute/virtualMachines/start", "Microsoft.Compute/virtualMachines/delete"], "NotActions": [] }
D. { "Actions": ["Microsoft.Compute/virtualMachines/delete"], "NotActions": ["Microsoft.Compute/virtualMachines/start"] }
Solution
Step 1: Identify required permissions
Users need to start and stop VMs, so all VM actions except delete are allowed.
Step 2: Check each option
{ "Actions": ["Microsoft.Compute/virtualMachines/*"], "NotActions": ["Microsoft.Compute/virtualMachines/delete"] } allows all VM actions with "*" but denies delete explicitly, matching requirements perfectly.