AZ-104 Manage Azure Identities and Governance Practice Question
A platform team wants to prevent engineers from creating VM sizes that are not approved, but they also need the engineers to be able to restart their own VMs. Which two statements are correct? Select two.
⚠ Common exam trap
Many candidates confuse Azure Policy (which enforces compliance on resource creation) with Azure RBAC (which controls permissions on existing resources), leading candidates to incorrectly assign policy to grant permissions or RBAC to deny creation.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use Azure Policy to deny creation of nonapproved VM sizes.
Azure Policy can enforce organizational standards by denying the creation of non-approved VM sizes through built-in policies like 'Allowed virtual machine SKUs'. This prevents engineers from provisioning unapproved VM sizes at the time of creation, ensuring compliance without blocking other actions. Option B is correct because Azure RBAC allows granular permission assignment, such as granting the 'Microsoft.Compute/virtualMachines/restart/action' to engineers, enabling them to restart their own VMs without granting broader management rights.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use Azure Policy to deny creation of nonapproved VM sizes.
Why this is correct
Azure Policy enforces admission control at deployment time: a policy definition with a Deny effect (commonly using the "Allowed virtual machine SKUs" built-in or a custom policy) blocks any Azure Resource Manager (ARM) request that tries to create a VM with a size not present in the allowed list. Because policy evaluation happens before resource creation, even attempts from Terraform, Bicep, or the portal will be rejected, making this the precise mechanism to prevent engineers from deploying unapproved VM sizes.
- ✓
Use Azure RBAC to grant the restart action on the VMs.
Why this is correct
Azure RBAC controls which users or principals can perform specific control-plane operations on existing resources. By creating a custom role that includes the action Microsoft.Compute/virtualMachines/restart/action, you can assign it to engineers at the resource group or individual VM scope, allowing them to restart VMs without granting broader create, delete, or modify permissions. This is a straightforward access-management approach that operates independently of any policy, and it is exactly how you delegate operational actions after a compliant VM is deployed.
- ✗
Use Azure Policy to grant restart permission when the VM is compliant.
Why it's wrong here
Azure Policy simply cannot grant restart permissions because it is not an access-control system. Policy definitions evaluate resource properties and can trigger effects like deny, audit, append, or deployIfNotExists, but they have no mechanism to assign role-based actions to users or principals. Even if a VM is compliant with a policy, the engineer's ability to restart it depends entirely on an RBAC role assignment that includes the restart action; the compliant state does not provide any authorization.
When this WOULD be correct
In a scenario where you need to automatically grant a role (e.g., Contributor) to a VM only when it is compliant with a policy (e.g., has specific tags), you could use Azure Policy with a DeployIfNotExists effect to assign an RBAC role. This would be correct if the question asked for automating role assignment based on compliance.
- ✗
Use a resource lock to approve only specific VM sizes.
Why it's wrong here
Resource locks are designed to protect a resource from accidental deletion or modification by setting the lock state to Delete or ReadOnly. They do not inspect VM size properties nor act as an approval gate for new deployments because a lock applies to an existing resource, not to the admission of future resources. Placing a resource lock on a VM does nothing to prevent the creation of a different VM with a nonapproved size, and a ReadOnly lock would actually block changes that could remediate a noncompliant VM.
When this WOULD be correct
In a scenario where an administrator wants to prevent accidental deletion or modification of a critical VM, a resource lock (e.g., CanNotDelete) would be the correct solution.
- ✗
Use tags to enforce the approved VM size list and restart action.
Why it's wrong here
Tags are key-value metadata used for cost tracking, resource organization, and filtering in Azure; they carry no enforcement logic and cannot prevent deployment of a nonapproved VM size. While you could tag a virtual machine with an approved size, tags are purely informational and do not intercept API calls, so an engineer could still create a VM using any SKU. Similarly, tags never grant RBAC permissions, so a tag cannot authorize the restart action—that capability can only come from a role assignment.
When this WOULD be correct
In a scenario where the question asks for a method to categorize VMs by approval status and trigger compliance workflows, tags could be used to mark approved VM sizes, and an automation runbook could restart tagged VMs.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.
✓Use Azure Policy to deny creation of nonapproved VM sizes.Correct answer▾
Why this is correct
Azure Policy enforces admission control at deployment time: a policy definition with a Deny effect (commonly using the "Allowed virtual machine SKUs" built-in or a custom policy) blocks any Azure Resource Manager (ARM) request that tries to create a VM with a size not present in the allowed list. Because policy evaluation happens before resource creation, even attempts from Terraform, Bicep, or the portal will be rejected, making this the precise mechanism to prevent engineers from deploying unapproved VM sizes.
✗Use Azure Policy to grant restart permission when the VM is compliant.Wrong answer — click to see why▾
Why this is wrong here
Azure Policy cannot grant permissions; it only enforces compliance rules. Granting restart permission is an RBAC function, not a Policy capability.
★ When this WOULD be the correct answer
In a scenario where you need to automatically grant a role (e.g., Contributor) to a VM only when it is compliant with a policy (e.g., has specific tags), you could use Azure Policy with a DeployIfNotExists effect to assign an RBAC role. This would be correct if the question asked for automating role assignment based on compliance.
Why candidates choose this
Candidates may confuse Azure Policy's ability to enforce compliance with granting permissions, or think that Policy can directly assign RBAC roles as part of its effects.
✗Use a resource lock to approve only specific VM sizes.Wrong answer — click to see why▾
Why this is wrong here
Resource locks prevent deletion or modification of resources but cannot restrict VM sizes to approved types; they operate at a resource level, not on configuration properties like SKU.
★ When this WOULD be the correct answer
In a scenario where an administrator wants to prevent accidental deletion or modification of a critical VM, a resource lock (e.g., CanNotDelete) would be the correct solution.
Why candidates choose this
Candidates may confuse resource locks with policy enforcement, thinking locks can restrict resource configurations like VM sizes, when locks only protect against deletion or changes.
✗Use tags to enforce the approved VM size list and restart action.Wrong answer — click to see why▾
Why this is wrong here
Tags are metadata labels, not security enforcement mechanisms. They cannot enforce approved VM sizes or grant restart permissions; Azure Policy and RBAC are required for those actions.
★ When this WOULD be the correct answer
In a scenario where the question asks for a method to categorize VMs by approval status and trigger compliance workflows, tags could be used to mark approved VM sizes, and an automation runbook could restart tagged VMs.
Why candidates choose this
Candidates may overestimate the capabilities of tags, thinking they can be used for access control or policy enforcement, when they are only for organization and automation triggers.
Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Quick reference
Access Control Model Comparison
| Model | Acronym | Who Controls Access? | Best For |
|---|---|---|---|
| Discretionary Access Control | DAC | Resource owner | Small teams, file shares |
| Mandatory Access Control | MAC | System / security labels | Classified govt / military |
| Role-Based Access Control | RBAC | Administrator (via roles) | Enterprise environments |
| Attribute-Based Access Control | ABAC | Policy engine (user + resource attributes) | Fine-grained, dynamic policies |
| Rule-Based Access Control | RuBAC | System rules / ACLs | Firewall rules, network ACLs |
Go deeper
Related to this question
Learn chapter
Privileged Identity Management (PIM)
Key term
Azure Policy
Azure Policy is a service in Microsoft Azure that lets you create, assign, and manage rules to ensure your resources stay compliant with your company standards and service-level agreements.
Key term
RBAC
RBAC is a method of restricting network access based on the roles of individual users within an organization, where permissions are assigned to roles rather than to individuals directly.
About these practice questions
Courseiva writes every AZ-104 question from scratch — 1,049 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-104 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-104 exam.