All Microsoft exams
Free AZ-104 practice test: 30 questions with answers
30 original questions for Microsoft Azure Administrator, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 100 questions
All 30 AZ-104 questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Manage Azure identities and governance (6 questions)
Question 1
An administrator wants to give a helpdesk group the ability to reset passwords for users in one department only. Which approach follows least privilege in Microsoft Entra ID?
- AAssigning a scoped administrative unit role to the helpdesk group for that department's users
- BGiving the helpdesk group the built-in Owner role at subscription scope, inherited by every resource group
- CAssigning the Global Administrator role to the helpdesk group so it can manage every tenant-wide setting
- DSharing a single administrator account with the helpdesk team, storing its password in a shared spreadsheet
Show answer and explanationHide answer
Correct answer: AAdministrative units scope directory roles to a subset of users, which limits the helpdesk to one department. Global Administrator and subscription Owner grant far more rights, and shared accounts are insecure.
Question 2
A user must be able to create virtual machines in one resource group only. Which Azure role should be assigned at the resource group scope?
- AOwner at the management group
- BUser Access Administrator at the root
- CReader at the subscription
- DVirtual Machine Contributor
Show answer and explanationHide answer
Correct answer: DVirtual Machine Contributor at the resource group scope permits VM management in that group only. Owner at a management group is broader, Reader cannot create VMs, and User Access Administrator manages access rather than resources.
Question 3
An organization wants to ensure that all resources in a subscription have a CostCenter tag. Which feature enforces this at creation time?
- AAzure Policy with a deny effect for resources missing the tag
- BA ReadOnly management lock applied to the subscription
- CA tag added manually to each resource after it is deployed
- DA monthly budget with an alert threshold at 80 percent
Show answer and explanationHide answer
Correct answer: AAzure Policy with a deny effect blocks resources that are created without the required tag. Manual tagging after deployment, locks and budgets do not enforce tagging at creation.
Question 4
A company wants to apply the same governance rules across several subscriptions. Which Azure feature groups the subscriptions so policies can be inherited?
- ANetwork security groups
- BStorage accounts
- CManagement groups
- DResource tags only
Show answer and explanationHide answer
Correct answer: CManagement groups organize subscriptions into hierarchies where policies and RBAC assignments are inherited. Tags, NSGs and storage accounts do not provide hierarchical inheritance.
Question 5
A resource group must not be deleted accidentally by any user, even those with Owner rights. Which setting should be applied?
- AAn Azure Policy with audit effect on the resource group
- BA Reader role assigned to every user in the directory tenant
- CA tag named protected on the resource group set to true
- DA CanNotDelete resource lock on the resource group
Show answer and explanationHide answer
Correct answer: DA CanNotDelete lock prevents deletion even for Owners until the lock is removed. Tags do not block deletion, audit policies only report, and Reader roles do not prevent deletion by Owners.
Question 6
A tenant administrator wants to bulk-create users from a CSV file in Microsoft Entra ID. Which tool supports this?
- AExcel formulas and VLOOKUP macros in a shared workbook stored on OneDrive for staff
- BA SharePoint list without automation, where names, usernames and departments are typed by hand
- CA Teams channel post listing new hires, which notifies members but creates no accounts
- DBulk operations in the Entra admin center or PowerShell with a CSV import
Show answer and explanationHide answer
Correct answer: DEntra bulk operations and PowerShell support importing users from CSV files. Spreadsheet formulas, channel posts and lists do not create directory users.
Deploy and manage Azure compute resources (6 questions)
Question 7
An application running on Azure VMs needs more capacity during peak hours and less at night, with instances added automatically. Which resource should be configured?
- AA single larger VM that runs continuously during business hours
- BA VM with a reserved static IP and no scaling rules
- CVirtual machine scale set with autoscale rules based on metrics
- DA managed disk resized to a larger size that adds storage capacity alone
Show answer and explanationHide answer
Correct answer: CScale sets with autoscale add and remove instances based on metrics or schedules. A single large VM, a static IP and a larger disk do not scale capacity automatically.
Question 8
A VM must be deployed from a custom image that includes pre-installed software and configuration for many identical VMs. Which resource should be created first?
- AA virtual network peering link connecting the VM's subnet to a second virtual network
- BA storage account network firewall that limits access by IP range
- CA generalized image or Azure Compute Gallery image definition and version
- DA delete resource lock applied to the resource group containing the image
Show answer and explanationHide answer
Correct answer: CA generalized image or a gallery image version provides a repeatable base for many VMs. Peering, storage firewalls and locks are not image resources.
Question 9
A VM is set to a size that does not provide enough memory for its workload. What is the simplest change that keeps the same VM and its data?
- AChanging the VM's name in the Azure portal, which does not alter its memory allocation or disks
- BAdding a tag to the VM for cost allocation in production, which leaves the memory size and disks unchanged
- CResizing the VM to a size with more memory, if available on the current hardware cluster
- DDeleting the VM and creating a new one from scratch without the original data
Show answer and explanationHide answer
Correct answer: CResizing keeps the VM and its disks while changing the size, provided the target size is available on the cluster. Deleting, renaming and tagging do not add memory.
Question 10
An administrator needs to run a script on several Windows VMs at once to install an update, and wants to see the results centrally. Which option fits?
- ARun command or Azure Automation runbooks targeting the VMs
- BPrinting the script on paper and posting it on the office wall
- CLogging into each VM with RDP one at a time to apply the update
- DEmailing the script as an attachment to each user for manual execution
Show answer and explanationHide answer
Correct answer: ARun command and runbooks execute scripts across VMs and collect results centrally. Manual logins, emailed scripts and printed copies do not provide central execution.
Question 11
A VM must be available during planned maintenance in the datacenter. Which configuration provides this?
- AA single VM with no redundancy and no standby copy kept elsewhere
- BA stopped VM that is started manually when needed by operators
- CA VM in a single zone with no other VMs in its group
- DAn availability set with multiple VMs across fault and update domains
Show answer and explanationHide answer
Correct answer: DAvailability sets spread VMs across fault and update domains so maintenance affects only some of them. Single VMs have no redundancy, and stopped VMs are unavailable.
Question 12
An Azure VM must be moved to a different region for disaster recovery. Which service should the administrator use to replicate it?
- AAzure Site Recovery
- BAzure Private DNS
- CAzure Bastion Hub
- DAzure Lighthouse Access
Show answer and explanationHide answer
Correct answer: AAzure Site Recovery replicates VMs to another region and supports failover. Bastion provides access, DNS resolves names and Lighthouse manages delegated access.
Configure and manage virtual networking (6 questions)
Question 13
Two virtual networks in the same region must communicate privately with low latency and no gateway. Which feature connects them?
- AA public IP on each VM
- BA site-to-site VPN gateway
- CA load balancer in the internet
- DVirtual network peering
Show answer and explanationHide answer
Correct answer: DVNet peering connects virtual networks privately without a gateway. Public IPs route over the internet, VPN gateways add an unnecessary hop, and internet load balancers are for public traffic.
Question 14
A network security group must allow inbound HTTPS traffic to a web subnet only. Which rule meets this requirement?
- AAn outbound allow rule for TCP port 443 to the internet from the web subnet for HTTPS
- BAn inbound allow rule for TCP port 443 from the internet with a specific destination of the web subnet
- CAn inbound allow rule for TCP ports 1-65535 from the internet to the web subnet
- DA deny rule for TCP port 80 on the web subnet to block inbound HTTP traffic at priority 4096
Show answer and explanationHide answer
Correct answer: BAn inbound allow for TCP 443 to the web subnet permits HTTPS. Allowing all ports is too broad, outbound rules control traffic leaving the subnet, and deny rules for port 80 do not allow HTTPS.
Question 15
NSG rules are evaluated for a VM. A rule with priority 100 denies port 3389, and a rule with priority 200 allows it. What is the result?
- ABoth rules cancel each other out and the port falls back to default
- BThe rules are ignored because they conflict on the same port
- CPort 3389 is allowed because the higher priority number wins
- DPort 3389 is denied because the lower priority number is evaluated first
Show answer and explanationHide answer
Correct answer: DNSG rules are processed by priority number, and lower numbers are evaluated first, so the deny at 100 applies. The other statements misunderstand processing order.
Question 16
A VM in a private subnet needs outbound internet access for updates, without any inbound connections from the internet. Which service provides this?
- AA public IP on the VM with inbound port 22 open
- BAzure NAT Gateway attached to the subnet
- CA VPN gateway to the internet
- DA load balancer with inbound rules
Show answer and explanationHide answer
Correct answer: BNAT Gateway provides outbound internet access for private subnets without exposing inbound ports. Public IPs with open ports and inbound load balancers expose the VM, and VPN gateways are for private connections.
Question 17
A company needs to connect its on-premises network to Azure over an encrypted tunnel for a small number of branches. Which service is the best fit?
- ASite-to-site VPN gateway
- BAzure Firewall Manager policy
- CAzure Bastion for RDP access
- DAzure Content Delivery Network
Show answer and explanationHide answer
Correct answer: AA site-to-site VPN gateway creates encrypted tunnels between on-premises and Azure. Bastion provides VM access, Firewall Manager manages firewalls, and CDN caches content.
Question 18
Administrators need secure RDP and SSH access to VMs without exposing management ports to the internet. Which service should be used?
- AA shared VPN password
- BA DNS record pointing to each VM
- CAzure Bastion
- DA public IP on every VM with port 3389 open
Show answer and explanationHide answer
Correct answer: CAzure Bastion provides browser-based RDP and SSH through a managed service without public management ports. The other options expose the VMs or fail to provide secure access.
Monitor and back up Azure resources (6 questions)
Question 19
Which two tools help assess and migrate on-premises workloads to Azure? (Choose two.)
- AAzure Site Recovery for replication
- BExcel for inventory only
- CMicrosoft Paint
- DAzure Bastion
- EAzure Migrate
Show answer and explanationHide answer
Correct answer: A, EAzure Migrate discovers and assesses workloads, and Site Recovery replicates them for migration. Spreadsheets, Paint and Bastion do not assess or migrate workloads.
Question 20
An administrator wants an alert when a VM's CPU stays above 85 percent for 10 minutes. Which resource should be created?
- AA diagnostic setting on the storage account to archive the VM logs
- BA CanNotDelete resource lock on the VM that blocks accidental deletion
- CA metric alert rule in Azure Monitor with an action group
- DA tag named HighCpuLoad with the value true applied to the VM as a label
Show answer and explanationHide answer
Correct answer: CMetric alert rules evaluate metrics over time and trigger action groups. Diagnostic settings send logs, locks protect resources, and tags label them.
Question 21
Platform logs for a Key Vault must be sent to a Log Analytics workspace for retention and querying. Which configuration is needed?
- AA diagnostic setting on the Key Vault that sends logs to the workspace
- BA CanNotDelete resource lock on the workspace that protects stored log data
- CA tag named LogRetention on the Key Vault that marks its logs
- DAn alert rule on CPU metrics with no action group configured
Show answer and explanationHide answer
Correct answer: AA diagnostic setting routes resource logs to a Log Analytics workspace. Tags, alerts without destinations and locks do not export logs.
Question 22
A team needs to query logs from many resources with a single language to troubleshoot an incident. Which tool should they use?
- AWindows File Explorer search on local disks
- BLog Analytics with Kusto Query Language (KQL)
- CMicrosoft Paint image editing tool
- DAzure Cost Management budgets and invoices
Show answer and explanationHide answer
Correct answer: BLog Analytics uses KQL to query logs across resources. Paint, cost tools and Explorer search do not query Azure logs.
Question 23
A VM must be backed up daily with 30 days of retention, and restores must be possible to a point in time. Which service should be used?
- AManually copying the VM OS disk to a USB drive weekly
- BStoring VM backups in a public blob container for staff
- CA VM snapshot created once and kept without an expiration policy applied
- DAzure Backup with a recovery services vault and a backup policy
Show answer and explanationHide answer
Correct answer: DAzure Backup with a vault and policy provides scheduled backups, retention and recovery points. Manual copies, one-time snapshots that never expire and public containers do not meet the requirement.
Question 24
Backup data must be protected from deletion by an attacker who has compromised an administrator account. Which feature helps most?
- AMulti-user authorization or soft delete with immutability settings in the recovery vault
- BTurning off the scheduled backup job in the recovery vault during weekends to reduce storage costs
- CSharing the vault password with the whole administrator team in a shared spreadsheet
- DDeleting the vault's diagnostic logs and activity log entries from the Log Analytics workspace
Show answer and explanationHide answer
Correct answer: AMulti-user authorization and soft delete protect backup data from malicious deletion. Shared passwords, weekend pauses and deleted logs weaken protection.
Implement and manage storage (6 questions)
Question 25
A company needs storage that is accessible from multiple Linux VMs at the same time using NFS, managed as a service. Which option fits?
- AManaged disk attached to one VM
- BA local temporary disk on each VM
- CAzure Blob Storage hot tier with public access
- DAzure Files NFS share
Show answer and explanationHide answer
Correct answer: DAzure Files NFS shares support shared POSIX-style access from multiple Linux VMs. Blob storage is object storage, a managed disk attaches to one VM, and temporary disks are not durable shared storage.
Question 26
A storage account must be accessible only from a specific virtual network and not from the internet. Which configuration achieves this?
- AA public blob container with a long-lived SAS token that grants write access to the whole account
- BDisabling HTTPS-only transfer on the storage account for legacy clients
- CStorage firewall with virtual network rules and public network access disabled
- DA shared access key posted in a team wiki page open to contributors
Show answer and explanationHide answer
Correct answer: CStorage firewall rules limit access to specified networks, and disabling public access blocks internet connections. Public containers, posted keys and disabled HTTPS all expose data.
Question 27
A team must give a partner temporary read-only access to one blob without sharing the storage account key. Which approach is best?
- ASharing the storage account key with the partner so they receive full read, write and delete control of it
- BEmailing a copy of the blob's contents to the partner as an email attachment
- CMaking the entire storage account public with anonymous read access enabled
- DA user delegation or service SAS with read permission, scoped to the blob and an expiry time
Show answer and explanationHide answer
Correct answer: DA scoped SAS with read permission and an expiry gives limited, time-bound access. Sharing account keys grants full control, public accounts expose everything, and emailing contents is inefficient and uncontrolled.
Question 28
Data in a blob container should move automatically to a cooler tier after 30 days without access and be deleted after a year. Which feature implements this?
- AAzure Backup vault with retention
- BStorage Explorer desktop bookmarks
- CLifecycle management policies
- DA ReadOnly resource lock on blobs
Show answer and explanationHide answer
Correct answer: CLifecycle management policies transition and delete blobs based on rules such as age and access. Backup vaults, Explorer bookmarks and locks do not move or delete blobs by rule.
Question 29
Which Azure storage redundancy option keeps copies of data in multiple availability zones within one region?
- AGeo-redundant storage (GRS) only
- BZone-redundant storage (ZRS)
- CLocally redundant storage (LRS)
- DRead-access geo-redundant storage with no zones
Show answer and explanationHide answer
Correct answer: BZRS replicates data synchronously across zones in one region. LRS keeps copies in one datacenter, and GRS replicates to a secondary region rather than across zones in the primary region.
Question 30
An administrator needs to protect blob data from accidental deletion for 14 days, with recovery possible for deleted items. Which feature should be enabled?
- AMaking the container read-only forever
- BSoft delete for blobs with a 14-day retention
- CTurning off all deletions in the subscription
- DStoring blobs as temporary disk files
Show answer and explanationHide answer
Correct answer: BSoft delete retains deleted blobs for a configured period so they can be recovered. Blocking all deletions is not practical, temporary disks are not durable, and read-only settings are a different control.
Want more AZ-104 questions?
The full bank has 100 questions with answers and explanations, as a PDF, an online practice exam, or both.
Both formats together. The best value.
Instant access after payment, with 90 days of updates. Checkout is on our store, AIExamCerts.