Skip to content

10 Free AZ-104 Practice Questions with Explanations

Practise Azure administration with 10 sample questions covering identity, storage, compute, networking and monitoring. Try each question, then review the answer and explanation. No account required.

Start with question 1
Work through the set

Four choices per question. Think through your answer, then open the explanation to check it.

10 questions · 5 domains · no timer

Identity and governance

Questions 1–2
Question 1 of 10Azure RBAC inheritance

Subscription Sub1 contains resource groups RG1, RG2 and RG3. Group1 is assigned the Contributor role at the Sub1 scope. The database team, Group2, is assigned Contributor at the RG1 scope, and no user is a member of both groups. Members of Group1 must no longer be able to modify any resource in RG1, but must keep managing everything in RG2 and RG3. Group2 must keep managing RG1. What should you do?

  1. Assign the Reader role to Group1 at the RG1 scope
  2. Remove Group1’s Contributor assignment at the Sub1 scope, and assign Group1 the Contributor role at the RG2 scope and at the RG3 scope
  3. Create a custom role that lists the write and delete operations in NotActions, and assign it to Group1 at the RG1 scope
  4. Apply a ReadOnly lock to RG1
Show answer and explanation

Correct answer: B · Remove Group1’s Contributor assignment at the Sub1 scope, and assign Group1 the Contributor role at the RG2 scope and at the RG3 scope

Azure RBAC is additive: a principal’s effective permissions are the union of all its role assignments, and an assignment at Sub1 is inherited by RG1. No role assignment you add at RG1 can take away what the subscription-level Contributor grants. The inherited access has to be removed at its source and re-granted only where it is still needed, at RG2 and RG3. Group2’s own assignment at RG1 is untouched.

Why the other choices do not fit

  • A. Reader is added on top of the inherited Contributor permissions, not instead of them. Group1’s effective access to RG1 is still Contributor.
  • C. NotActions only subtracts operations from that custom role’s own Actions. It is not a deny, so it cannot remove permissions that the Contributor assignment at Sub1 already grants.
  • D. A ReadOnly lock would stop Group1 from modifying RG1, but locks apply to every user regardless of role, so Group2 could no longer manage RG1 either.
Question 2 of 10Azure Policy versus RBAC

User1 has the Reader role on subscription Sub1. Sub1 has a policy assignment that denies deployments of resources outside the East US region. Resource group RG1 in Sub1 contains the virtual network VNet1. User1 tries to deploy VM1 to RG1 in East US, with a new network interface connected to an existing subnet of VNet1, an existing network security group, and no public IP address. The deployment fails. You need User1 to be able to deploy VM1. The solution must follow the principle of least privilege. What should you do?

  1. Assign User1 the Owner role for Sub1
  2. Create a policy exemption for RG1
  3. Set the enforcement mode of the policy assignment to Disabled
  4. Assign User1 the Virtual Machine Contributor role for RG1
Show answer and explanation

Correct answer: D · Assign User1 the Virtual Machine Contributor role for RG1

The policy is a red herring: East US is an allowed region, so the policy would not deny this request. The deployment fails because Reader grants no write operations. Virtual Machine Contributor at RG1 allows creating the VM, its disks and its network interface, joining the existing subnet and network security group, and running the deployment, all limited to RG1.

Why the other choices do not fit

  • A. Owner at Sub1 would let User1 deploy VM1, but it also grants full control of every resource in the subscription and the right to assign roles, which is far beyond least privilege.
  • B. An exemption only stops a policy assignment from being evaluated for RG1. It grants no permissions, so Reader still cannot write anything, and the policy was not blocking an East US deployment anyway.
  • C. Disabled enforcement stops the deny effect from firing, but it grants no permissions. The request is still rejected because Reader has no write actions.

Storage

Questions 3–4
Question 3 of 10Anonymous blob access

The general-purpose v2 storage account contosoweb has Allow Blob anonymous access set to Disabled. Its container images1 has the anonymous access level Private. Contoso’s public website must load product images from images1 through direct blob URLs with no authentication and no SAS token. Anonymous users must not be able to list the contents of images1. The solution must follow the principle of least privilege. What should you do?

  1. Set the anonymous access level of images1 to Blob
  2. Set the anonymous access level of images1 to Container
  3. Enable Allow Blob anonymous access on contosoweb, and then set the anonymous access level of images1 to Blob
  4. Enable Allow Blob anonymous access on contosoweb, and then set the anonymous access level of images1 to Container
Show answer and explanation

Correct answer: C · Enable Allow Blob anonymous access on contosoweb, and then set the anonymous access level of images1 to Blob

Anonymous access needs two settings. The account-level setting overrides every container, and while it is disabled you cannot set a container’s access level to anything but Private. Once the account allows anonymous access, the Blob level lets anonymous clients read blobs by URL but not enumerate the container, which is the least open level that works.

Why the other choices do not fit

  • A. Blob is the right level, but while anonymous access is disallowed on the account the container setting cannot be applied, and no container allows anonymous reads.
  • B. Container is also blocked by the account setting, and it would let anonymous users list the blobs in images1, which the requirement forbids.
  • D. This makes the images readable, but the Container level also allows anonymous listing of images1, so it over-grants and breaks the no-listing requirement.
Question 4 of 10Azure Files share snapshots

The general-purpose v2 storage account fabstore2 hosts the SMB file share share1, which has 30 manually created share snapshots taken over the past two years. share1 is scheduled for deletion at the end of the month. Regulators require the data captured in those snapshots to stay retrievable for three years. The deletion of share1 must not be delayed. What should you do first?

  1. Use AzCopy to copy the required contents of the snapshots to a different storage account
  2. Enable soft delete for file shares on fabstore2 with a 365-day retention period
  3. Postpone the deletion of share1 and apply a CanNotDelete lock to fabstore2
  4. Configure Azure Backup for share1 so that its snapshots are leased and protected from deletion
Show answer and explanation

Correct answer: A · Use AzCopy to copy the required contents of the snapshots to a different storage account

Share snapshots are not independent of their share: you cannot delete a share and keep its snapshots, because the delete removes them all. The data has to be copied out before share1 goes. A snapshot cannot be copied to another account as a whole, so the copy is made file by file with a tool such as AzCopy.

Why the other choices do not fit

  • B. Soft delete keeps a deleted share, with its snapshots, for at most 365 days, which is short of the three-year requirement.
  • C. Postponing the deletion directly violates the requirement not to delay it.
  • D. Azure Backup leases only the snapshots it takes itself, not the 30 existing manual ones. A share with leased snapshots also can no longer be deleted in one step, which gets in the way of the scheduled deletion.

Compute

Questions 5–6
Question 5 of 10Availability sets

The availability set AVSet1 was created with 5 update domains and contains two virtual machines, VM1 and VM2. Their managed disks have the delete option set to Detach. You need AVSet1 to have 10 update domains. The availability set must keep the name AVSet1, and the virtual machines’ disks must be preserved. What should you do first?

  1. Change the update domain count of AVSet1 in the Azure portal
  2. Delete AVSet1, and then re-create it with 10 update domains
  3. Create an availability set with 10 update domains, and then move VM1 and VM2 into it
  4. Delete VM1 and VM2, keeping their disks
Show answer and explanation

Correct answer: D · Delete VM1 and VM2, keeping their disks

Fault and update domain counts are fixed when an availability set is created, so AVSet1 has to be re-created to get 10 update domains. An availability set that still contains VMs cannot be deleted, and a VM can join an availability set only when the VM is created. The first step is therefore to delete VM1 and VM2 while keeping their disks. Then delete AVSet1, re-create it with 10 update domains, and re-create the VMs from the existing disks.

Why the other choices do not fit

  • A. The update domain count cannot be changed after the availability set is created.
  • B. This is the right second step, but AVSet1 cannot be deleted while VM1 and VM2 are still in it.
  • C. Existing VMs cannot be moved into an availability set; they must be re-created in it. A new set would also have a different name, breaking the requirement to keep AVSet1.
Question 6 of 10Deployment slots and managed identity

The web app app2 runs in a Standard App Service plan with a production slot and a staging slot, each with a system-assigned managed identity. Key vault KV1 uses the Azure RBAC permission model. The staging slot’s identity holds the Key Vault Secrets User role on KV1, and the new app version reads its secrets successfully in staging. After you swap staging into production, the new version, now in production, can no longer read secrets from KV1. You need the new version in production to read secrets from KV1. The solution must follow the principle of least privilege. What should you do?

  1. Grant the staging slot’s managed identity the Key Vault Secrets User role on KV1
  2. Grant the production slot’s managed identity the Key Vault Secrets User role on KV1
  3. Grant the production slot’s managed identity the Key Vault Administrator role on KV1
  4. Swap the staging and production slots again
Show answer and explanation

Correct answer: B · Grant the production slot’s managed identity the Key Vault Secrets User role on KV1

Managed identities are among the settings that are not swapped: they stay with the slot. After the swap the new code runs in the production slot under the production slot’s identity, which has no role on KV1. Granting that identity Key Vault Secrets User gives it read access to secret contents and nothing more.

Why the other choices do not fit

  • A. The staging identity already has the role. It no longer runs the new version, because the identity stayed in the staging slot when the code moved to production.
  • C. This fixes the failure, but Key Vault Administrator allows all data-plane operations on the vault, far more than reading secrets.
  • D. Swapping back moves the old version into production, so the new version is no longer in production and the requirement is not met.

Networking

Questions 7–8
Question 7 of 10Private endpoints and hybrid DNS

Contoso connects its on-premises network to VNet1 through an ExpressRoute circuit with private peering. Application servers in Subnet1 of VNet1 use Azure-provided DNS. On-premises analysts use Contoso’s on-premises DNS servers, which resolve internet names through public DNS. Both groups must read blobs from the storage account storage1 by using the URL https://storage1.blob.core.windows.net, which must not change. The storage team will set Public network access on storage1 to Disabled, and all traffic to storage1 must use private IP addresses and never cross the internet. Which configuration should you implement?

  1. Enable a Microsoft.Storage service endpoint on Subnet1, add Subnet1 to the virtual network rules of storage1, and add the public IP range of the on-premises network to the storage1 firewall
  2. Create a private endpoint for the blob subresource of storage1 in Subnet1, and link the privatelink.blob.core.windows.net private DNS zone to VNet1. Make no on-premises DNS changes, because ExpressRoute private peering already advertises Subnet1 to on-premises
  3. Create a private endpoint for the blob subresource of storage1 in Subnet1, link the privatelink.blob.core.windows.net private DNS zone to VNet1, deploy an Azure DNS Private Resolver inbound endpoint in VNet1, and add an on-premises conditional forwarder for blob.core.windows.net to the inbound endpoint’s IP address
  4. Create a private endpoint for the blob subresource of storage1 in Subnet1, link the privatelink.blob.core.windows.net private DNS zone to VNet1, and add an on-premises conditional forwarder for blob.core.windows.net to 168.63.129.16
Show answer and explanation

Correct answer: C · Create a private endpoint for the blob subresource of storage1 in Subnet1, link the privatelink.blob.core.windows.net private DNS zone to VNet1, deploy an Azure DNS Private Resolver inbound endpoint in VNet1, and add an on-premises conditional forwarder for blob.core.windows.net to the inbound endpoint’s IP address

Only a private endpoint gives storage1 a private IP address, and with public network access disabled only private endpoint traffic is accepted. The private DNS zone linked to VNet1 makes the unchanged URL resolve to that private IP for the application servers. On-premises DNS cannot query that zone directly: queries must come from inside a linked virtual network. A Private Resolver inbound endpoint accepts them there, and Microsoft recommends forwarding the public zone, blob.core.windows.net, not the privatelink zone. The analysts then get the private IP, and their traffic flows over ExpressRoute private peering.

Why the other choices do not fit

  • A. A service endpoint still targets storage1’s public endpoint, and it only applies to traffic that starts inside the subnet, not on-premises. With public network access disabled, virtual network and IP firewall rules no longer admit anything, and the on-premises path would cross the internet anyway.
  • B. The routing is there, but name resolution is not. On-premises DNS resolves storage1.blob.core.windows.net through public DNS to the public IP address, so the analysts’ traffic heads to the internet and is rejected because public access is disabled.
  • D. This forwards the right zone to the wrong place. 168.63.129.16 is a virtual IP that is reachable only from inside an Azure virtual network, never across ExpressRoute or VPN, so on-premises queries time out.
Question 8 of 10Hub-and-spoke service chaining

In West US, the virtual network Hub1 contains a network virtual appliance, NVA1, at 10.0.1.4. IP forwarding is enabled on NVA1’s network interface and in its operating system. Hub1 has no virtual network gateway. Spoke1 and Spoke2 are each peered with Hub1, but not with each other. Virtual machines in Spoke1 must communicate with virtual machines in Spoke2, and all traffic between the spokes must be inspected by NVA1. What should you do?

  1. In Spoke1 and Spoke2, associate route tables with routes to the other spoke’s address space that use next hop type Virtual appliance and address 10.0.1.4, and on each spoke’s peering to Hub1 allow the spoke to receive forwarded traffic
  2. In Spoke1 and Spoke2, associate route tables with routes to the other spoke’s address space that use next hop type Virtual network gateway, and enable gateway transit on Hub1’s peerings
  3. Create a peering between Spoke1 and Spoke2, and allow forwarded traffic on both sides of that peering
  4. On Hub1’s peerings to the spokes, allow gateway transit, and on each spoke’s peering to Hub1, enable Use remote gateways
Show answer and explanation

Correct answer: A · In Spoke1 and Spoke2, associate route tables with routes to the other spoke’s address space that use next hop type Virtual appliance and address 10.0.1.4, and on each spoke’s peering to Hub1 allow the spoke to receive forwarded traffic

Peering is not transitive, so spoke-to-spoke traffic has to be chained through the hub. User-defined routes in each spoke send traffic for the other spoke to NVA1’s private IP. When NVA1 forwards a packet on, it arrives in the destination spoke from Hub1 but did not originate in Hub1. Each spoke’s peering must therefore allow it to receive forwarded traffic, in both directions.

Why the other choices do not fit

  • B. Hub1 has no virtual network gateway to route through, and a gateway next hop would bypass NVA1 even if one existed.
  • C. A direct spoke-to-spoke peering restores connectivity, but traffic flows straight between the spokes and never passes through NVA1, so the inspection requirement fails.
  • D. Gateway transit and remote gateways share a VPN or ExpressRoute gateway for connectivity through it. Hub1 has no gateway, and these settings do not send spoke-to-spoke traffic through an appliance.

Monitoring and backup

Questions 9–10
Question 9 of 10Azure VM backup policies

VM1 hosts a transactional line-of-business application. The business requires a recovery point objective (RPO) of no more than four hours for the whole VM, and recovery points must be retained for five years for audit. You need to configure protection for VM1 with Azure Backup while minimizing administrative effort. What should you do?

  1. Assign a Standard backup policy with daily backups and yearly retention of five years
  2. Install the MARS agent on VM1 and schedule three backups per day to a Recovery Services vault
  3. Replicate VM1 to the paired region by using Azure Site Recovery
  4. Assign an Enhanced backup policy with an hourly schedule every 4 hours and yearly retention of five years
Show answer and explanation

Correct answer: D · Assign an Enhanced backup policy with an hourly schedule every 4 hours and yearly retention of five years

Only the Enhanced policy can back up an Azure VM several times a day. Its hourly schedule runs every 4, 6, 8, 12 or 24 hours, so every 4 hours meets the RPO. Its retention settings can keep yearly recovery points for five years.

Why the other choices do not fit

  • A. A Standard policy backs up a VM at most once a day, which gives an RPO of up to 24 hours.
  • B. MARS backs up files, folders and system state, not the whole VM, and at three backups a day the gap between them is eight hours. It also adds an agent to deploy and maintain.
  • C. Site Recovery gives a very low RPO for disaster recovery, but it keeps recovery points for days, not years, so it cannot meet the five-year retention requirement.
Question 10 of 10Boot diagnostics

VM8 runs Windows Server 2019 and does not have the Special Administration Console (SAC) enabled. After a driver update it no longer completes its boot sequence and cannot be reached over RDP. You need to see what the operating system displayed on screen when the boot sequence failed. The solution must not depend on any agent running inside VM8’s guest operating system. What should you do?

  1. Enable boot diagnostics on VM8 and review the serial log
  2. Enable boot diagnostics on VM8 and view the screenshot
  3. Enable VM insights on VM8 and review the Performance tab
  4. Send VM8’s activity log to a Log Analytics workspace and query it with KQL
Show answer and explanation

Correct answer: B · Enable boot diagnostics on VM8 and view the screenshot

Boot diagnostics is collected by the Azure platform, so it works even when the guest never finishes booting. Its screenshot shows the VM’s current console screen, which is exactly what the operating system displayed.

Why the other choices do not fit

  • A. The serial log is text that the guest writes to its serial port, not the screen. On Windows that output depends on SAC, which is not enabled on VM8, so the log would show little or nothing useful.
  • C. VM insights depends on Azure Monitor Agent running inside the guest, which never gets to start, and performance data would not show the boot screen anyway.
  • D. The activity log records control-plane operations such as restarts and configuration changes, not what the guest operating system displays.

These are practice questions, not actual exam questions. The selected answers and explanations were checked against the linked Microsoft Learn documentation on 26 September 2026. Azure services and exam objectives can change, so use the references for the latest details. Pass104 is independent of Microsoft.