Microsoft · AZ-104
AZ-104 practice questions with answers
15 free practice questions for the Microsoft Certified: Azure Administrator Associate (AZ-104) exam, spread across the exam's domains. Try each one, then open the answer to see why every option is right or wrong.
Question 1 · Manage Azure identities and governance
Security wants to block deletion of specific resource types across subscriptions through policy rather than locks. Which Azure Policy effect fits?
- ADenyAction
- BAudit
- CAppend
- DDisabled
Show answer and explanation
Answer: A) DenyAction
- AThe denyAction effect can block specified actions, such as delete, on matching resources.
- BAudit reports but doesn't block.
- CAppend adds properties; that doesn't meet this requirement.
- DDisabled turns the policy off.
Question 2 · Manage Azure identities and governance
A user has the Contributor role on a resource group. Which action can they NOT perform there?
- AGrant another user access to the resource group
- BCreate a new storage account in the resource group
- CDelete a virtual machine in the resource group
- DRestart a virtual machine in the resource group
Show answer and explanation
Answer: A) Grant another user access to the resource group
- AContributor can create and manage all resource types but cannot manage role assignments (grant/revoke access); that requires Owner or User Access Administrator.
- BCreating resources is exactly what Contributor allows.
- CContributor can delete resources it manages.
- DOperational actions like restarting a VM are within Contributor's rights.
Question 3 · Manage Azure identities and governance
An administrator can't remove a role restriction on a managed application's resources, even as Owner. The restriction was created by the platform. What is it?
- AA deny assignment
- BA custom RBAC role
- CA management group tag
- DA resource lock note
Show answer and explanation
Answer: A) A deny assignment
- ADeny assignments block actions regardless of role assignments and can't be removed directly by users.
- BA custom role grants permissions; Owners can remove its assignments.
- CTags are metadata and don't restrict actions.
- DLocks can be removed by users with the right permissions.
Question 4 · Manage Azure identities and governance
A resource group is created in West Europe. Where can resources inside it be deployed?
- AIn any region
- BOnly in West Europe
- COnly in the paired region
- DOnly in global regions
Show answer and explanation
Answer: A) In any region
- AThe group's location only stores its metadata; resources can be in other regions.
- BResources don't have to match the group's region.
- CThere's no such restriction.
- DResources can be regional.
Question 5 · Implement and manage storage
Two days ago a user overwrote an important document on an SMB Azure file share. Azure Backup protects the share and takes a share snapshot of it every day. The user needs the earlier content of the document back. What should the administrator do?
- AOpen a share snapshot taken before the overwrite and restore that version of the file
- BUse file share soft delete to undelete the earlier version of the document
- CInitiate a storage account failover and read the document from the secondary region
- DEnable blob versioning on the storage account and restore the previous document version
Show answer and explanation
Answer: A) Open a share snapshot taken before the overwrite and restore that version of the file
Share snapshots, taken manually or by Azure Backup, are read-only point-in-time copies of an Azure file share. You recover an overwritten file by copying or restoring it from a snapshot taken before the change.
- ACorrect. A share snapshot is a read-only, point-in-time copy of the share, and you can retrieve individual files from it. In the portal, open the share's Snapshots view and choose Restore. On Windows, use the Previous Versions tab of the mounted share.
- BIncorrect. Soft delete for Azure Files protects against deletion of a whole file share. It does not keep earlier versions of individual files that were overwritten.
- CIncorrect. Geo-replication copies the current state of the data, including the overwrite, to the secondary region. Failover is for regional outages, not for recovering earlier versions.
- DIncorrect. Blob versioning applies to Blob Storage, not Azure Files. It also cannot recover versions from before it was turned on.
Question 6 · Implement and manage storage
An administrator is deciding between locally redundant storage (LRS) and zone-redundant storage (ZRS) for a general-purpose v2 storage account. What is the primary benefit of choosing ZRS over LRS?
- AData is copied synchronously across three or more availability zones in the primary region, so it remains readable and writable if one zone fails
- BData is copied asynchronously to the paired secondary region, so it remains durable if the entire primary region suffers an outage
- CData is kept as multiple copies on separate racks within one datacenter, so it is protected against drive, server, and rack failures
- DData in a secondary region becomes available through a read-only endpoint, so applications can keep reading during a primary region outage
Show answer and explanation
Answer: A) Data is copied synchronously across three or more availability zones in the primary region, so it remains readable and writable if one zone fails
ZRS replicates data synchronously across three or more availability zones in the primary region, so data stays available if a zone or datacenter fails. LRS keeps all replicas in a single datacenter. Neither option replicates data to another region.
- ACorrect. ZRS writes synchronously to replicas in three or more availability zones, so data stays available for reads and writes if one zone becomes unavailable. LRS keeps all of its replicas in a single datacenter.
- BIncorrect. This describes geo-redundant options (GRS/GZRS). ZRS stays within the primary region and on its own doesn't protect against a region-wide disaster.
- CIncorrect. This describes LRS, which keeps its replicas in a single physical datacenter. A datacenter-level event could make all LRS replicas unavailable.
- DIncorrect. Read access to a secondary region requires RA-GRS or RA-GZRS. ZRS has no secondary region or secondary endpoint.
Question 7 · Implement and manage storage
You must give a partner time-limited read access to a blob container. Your security team plans to disallow Shared Key authorization on the storage account, and the SAS you issue must keep working after that change. Which type of SAS should you issue?
- AA user delegation SAS signed with a key requested by an authorized security principal
- BA service SAS associated with a stored access policy defined on the container
- CAn account SAS scoped to the Blob service with only the read permission granted
- DA service SAS with a near-term expiry time that allows only the HTTPS protocol
Show answer and explanation
Answer: A) A user delegation SAS signed with a key requested by an authorized security principal
Service SAS and account SAS are both signed with the storage account key and authorized through Shared Key. Only a user delegation SAS, signed with a user delegation key obtained with Microsoft Entra credentials, keeps working when Shared Key authorization is disallowed.
- ACorrect. A user delegation SAS is signed with a user delegation key created using Microsoft Entra credentials, and it is authorized through Microsoft Entra ID rather than Shared Key. It doesn't depend on the account keys, so it keeps working when Shared Key authorization is disallowed. Microsoft recommends this SAS type when possible.
- BIncorrect. A stored access policy lets you revoke a service SAS without regenerating keys. However, a service SAS is still signed with the storage account key and authorized through Shared Key, so it would stop working once Shared Key is disallowed.
- CIncorrect. Limiting services and permissions reduces exposure, but an account SAS is always signed with the storage account key. It depends on Shared Key authorization.
- DIncorrect. A short expiry and HTTPS-only are good practice, but they don't change how the token is signed. A service SAS is still secured with the account key and relies on Shared Key.
Question 8 · Deploy and manage Azure compute resources
An App Service web app must call an internal API on a private IP in a VNet. Which feature lets the app send that outbound traffic into the VNet?
- AVNet integration
- BA deployment slot for the API
- CAn access restriction rule
- DAlways On
Show answer and explanation
Answer: A) VNet integration
- AVNet integration routes the app's outbound traffic into the virtual network.
- BSlots stage releases; they don't provide network connectivity to a VNet.
- CAccess restrictions filter inbound traffic to the app, not outbound calls.
- DAlways On keeps the app loaded; it doesn't connect it to a VNet.
Question 9 · Deploy and manage Azure compute resources
You deploy a VM from a standard Azure Marketplace Windows Server image. Right after deployment, a PowerShell script you've already written, stored in an Azure Storage account, must download and run automatically with no one signing in. The script installs several applications and then joins the VM to an Active Directory domain. Which mechanism should you use?
- AAdd the Custom Script Extension to the VM, pointing it at the script's blob URI
- BPass the script as custom data in the VM's OS profile when the VM is created
- CAdd the JsonADDomainExtension to the VM with the domain name and join credentials
- DOpen Serial Console in the portal and run the script from a PowerShell channel
Show answer and explanation
Answer: A) Add the Custom Script Extension to the VM, pointing it at the script's blob URI
The Custom Script Extension downloads a script from Azure Storage and runs it unattended after deployment, so it covers both the software installs and the domain join. Custom data isn't processed on standard Windows images, JsonADDomainExtension only joins the domain, and Serial Console is interactive.
- ACorrect. The Custom Script Extension downloads scripts from Azure Storage or GitHub and runs them on the VM. It's intended for post-deployment configuration and software installation, and you can deploy it with ARM templates, PowerShell, the Azure CLI or the portal.
- BIncorrect. On Windows, custom data is written to %SystemDrive%\AzureData\CustomData.bin, but it isn't processed. To run it, you'd have to build a custom image with your own code that reads the file. A standard Marketplace image won't run it.
- CIncorrect. JsonADDomainExtension joins the VM to a domain, but it can't run your custom script, so the application installs wouldn't happen.
- DIncorrect. Serial Console is an interactive, text-based console for troubleshooting. Someone has to connect and sign in with credentials, so it doesn't meet the requirement for automatic, unattended execution.
Question 10 · Deploy and manage Azure compute resources
Your platform team maintains approved ARM templates. Application teams must be able to deploy specific versions of these templates by using standard Azure tools. Access must be controlled with Azure RBAC rather than shared tokens, and deployers must not be able to change the templates. What should you use?
- ATemplate specs stored in a shared resource group
- BA blob container in a storage account, with SAS tokens issued to each team
- CAzure Policy definitions that use the deployIfNotExists effect
- DTemplates exported from a reference resource group by using Export template
Show answer and explanation
Answer: A) Template specs stored in a shared resource group
Template specs store ARM templates as versioned Azure resources. Teams with read access can deploy them through Azure RBAC without SAS tokens and without permission to change the templates.
- ACorrect. A template spec is an Azure resource (Microsoft.Resources/templateSpecs) that stores an ARM template and supports versions. Access is managed with Azure RBAC, and users need only read access, such as the Template Spec Reader role, to deploy it without being able to modify it.
- BIncorrect. Templates in a storage account must be made public or shared with SAS tokens, which is exactly the token-based access the requirement rules out. Microsoft lists this as a problem that template specs solve.
- CIncorrect. deployIfNotExists policies deploy remediation resources automatically when a policy condition is met. They aren't a catalog of versioned templates that teams choose to deploy themselves.
- DIncorrect. Export template creates a one-time snapshot of a resource group's configuration. The result isn't stored as a versioned, RBAC-controlled Azure resource that other teams can deploy.
Question 11 · Implement and manage virtual networking
Which Azure service connects two virtual networks so resources in each can communicate using private IP addresses, without traffic going over the public internet?
- AVNet peering
- BA public load balancer
- CAzure Content Delivery Network
- DA public IP address assigned to each VM
Show answer and explanation
Answer: A) VNet peering
- AVNet peering connects two virtual networks directly over the Microsoft backbone network, allowing private-IP communication without traversing the public internet.
- BA public load balancer distributes internet-facing traffic to backend resources; it doesn't connect two VNets to each other.
- CA CDN caches and serves content to end users from edge locations; it doesn't connect two virtual networks.
- DAssigning public IPs routes traffic over the internet, the opposite of the private, non-internet connectivity VNet peering provides.
Question 12 · Implement and manage virtual networking
You need a private, dedicated connection between your on-premises datacenter and Azure that does not traverse the public internet and offers higher, more predictable bandwidth and lower latency than a VPN. Which option should you choose?
- AAzure ExpressRoute
- BA site-to-site VPN gateway
- CA point-to-site VPN
- DVNet peering
Show answer and explanation
Answer: A) Azure ExpressRoute
- AExpressRoute provides a private circuit through a connectivity provider, bypassing the public internet with consistent bandwidth, lower latency, and an availability SLA.
- BA site-to-site VPN runs encrypted over the public internet, so bandwidth and latency are less predictable.
- CPoint-to-site connects individual client devices over the internet, not a whole datacenter privately.
- DPeering connects Azure VNets to each other, not on-premises networks.
Question 13 · Implement and manage virtual networking
In a hub-and-spoke topology, spoke VNets should reach on-premises through the VPN gateway that lives in the hub VNet. Which peering settings make this work?
- AOn the hub-to-spoke peering, enable 'Allow gateway transit'; on the spoke-to-hub peering, enable 'Use remote gateways'
- BEnable 'Use remote gateways' on both sides of every peering
- CAdd a user-defined route of 0.0.0.0/0 to the internet on each spoke
- DPeer every spoke directly to every other spoke
Show answer and explanation
Answer: A) On the hub-to-spoke peering, enable 'Allow gateway transit'; on the spoke-to-hub peering, enable 'Use remote gateways'
- AGateway transit lets the hub share its VPN/ExpressRoute gateway with peered spokes; each spoke must opt in with 'Use remote gateways' and must not have its own gateway.
- BOnly the spoke consumes the remote gateway; the hub side provides transit. Setting it on the hub is invalid.
- CThat sends traffic to the internet, not through the hub's on-prem VPN gateway.
- DA full mesh doesn't provide on-premises connectivity and defeats the hub-and-spoke design.
Question 14 · Monitor and maintain Azure resources
An application that runs on several Azure resources started failing this morning. You suspect someone changed a resource setting through Azure Resource Manager in the last few days. You want to quickly see which resource properties changed, when they changed, and who changed them. What should you use?
- AChange Analysis in Azure Resource Graph, queried for the affected resources
- BA metric alert rule on CPU percentage scoped to the resource group
- CA diagnostic setting that sends the resources' logs to a storage account
- DA ReadOnly resource lock applied to the application's resource group
Show answer and explanation
Answer: A) Change Analysis in Azure Resource Graph, queried for the affected resources
Change Analysis in Azure Resource Graph shows recent control-plane changes to resources, including what changed, when, and who made the change. That makes it the quickest way to link a failure to a configuration change.
- AChange Analysis is built on Azure Resource Graph. It records create, update and delete operations sent through the Azure Resource Manager control plane, and shows the properties that changed, when, and the change actor. Changes can be queried for 14 days with no onboarding.
- BA metric alert tells you when a performance threshold is crossed in the future. It doesn't show which configuration properties changed in the past or who changed them.
- CDiagnostic settings only route platform logs and metrics to a destination from the time they are created. They don't give you a summary of past property changes, so they can't answer the question quickly.
- DA lock stops future management changes. It records nothing about changes that have already happened.
Question 15 · Monitor and maintain Azure resources
An operations team needs one shareable, interactive report in the Azure portal. It must mix explanatory text, metric charts from several virtual machines, and KQL query results from a Log Analytics workspace. Drop-down parameters must let viewers filter the report's visualizations. Which Azure Monitor feature should you use?
- AAzure Monitor Workbooks
- BAzure Monitor metrics explorer
- CThe Log Analytics query editor
- DAzure Resource Graph Explorer
Show answer and explanation
Answer: A) Azure Monitor Workbooks
Azure Monitor Workbooks are made for interactive reports that combine text, metrics, log query results and parameters from several sources and can be shared. The other tools each work with only one kind of data.
- ACorrect. Workbooks combine text, log queries, metrics and parameters into rich interactive reports. They can pull data from several sources into one report and can be saved as shared workbooks for the team.
- BIncorrect. Metrics explorer plots and correlates metric values. It doesn't combine explanatory text, KQL log query results and parameters into one report, although you can send a chart from it to a workbook or dashboard.
- CIncorrect. The Logs query editor runs KQL queries and shows the results. It doesn't build a multi-section report that combines text, metric charts and shared parameters.
- DIncorrect. Resource Graph Explorer queries resource inventory and properties across subscriptions. It doesn't chart performance metrics or Log Analytics data, and it doesn't build interactive reports.
Ready for a full AZ-104 practice exam?
These are a sample from the CertRidge question bank. Full practice exams match the real exam's length, time limit and domain weights, with every answer explained.
Original questions written from the official exam guide. Not affiliated with Microsoft; never copied from the real exam.