# Free AZ-104 practice questions

> 10 free AZ-104 practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/microsoft-az-104/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/microsoft-az-104/

### Question 1 of 10

A partner company's consultants need access to a single resource group in your subscription. They must sign in with their own organizational accounts, and your IT team must not manage their passwords. What should you do?

- A. Synchronize the partner's on-premises Active Directory accounts into your tenant with Microsoft Entra Connect
- B. Create member accounts for the consultants in your tenant and enable self-service password reset for them
- C. Create a shared service principal with a client secret and give the secret to the partner company's lead
- D. Invite the consultants as B2B guest users and assign them an Azure RBAC role on the resource group

**Answer:** D

**Explanation:** Microsoft Entra B2B collaboration lets external users authenticate with their home identity while you grant them RBAC roles on your resources, so you never manage their credentials. Creating member accounts makes your team responsible for those identities and passwords. A shared service principal secret is not tied to individual people and cannot be audited per user. Synchronizing another organization's directory into your tenant is not supported for this purpose and would also make you own the accounts.

### Question 2 of 10

Your company has 12 subscriptions under a Microsoft Customer Agreement. Three of them are the only subscriptions in a management group named MG-Retail. Finance needs one budget that alerts when the combined monthly cost of those three subscriptions reaches 80% of 50,000 USD. Which scope should you use for the budget?

- A. A resource group in one of the three subscriptions
- B. The MG-Retail management group
- C. The billing account, without filters
- D. Each of the three subscriptions, with a budget of 16,667 USD

**Answer:** B

**Explanation:** A budget on the MG-Retail management group evaluates the combined cost of every subscription in it, and those are exactly the three subscriptions, so one 50,000 USD budget with an 80% alert threshold does the job. Three separate 16,667 USD budgets alert on each subscription's own cost, so one subscription can trigger an alert while the combined total is still low, or the total can pass 40,000 USD without any single alert. A resource group budget sees only that resource group. A billing account budget without filters counts all 12 subscriptions.

### Question 3 of 10

Your organization uses Microsoft Entra Connect to synchronize on-premises Active Directory users. Users who reset their passwords through SSPR in the cloud report that their on-premises domain password does not change. What must be enabled?

- A. Staged rollout of cloud authentication for the synchronized users' security group
- B. Password writeback in Entra Connect and the SSPR on-premises integration setting
- C. Password hash synchronization with a shorter synchronization interval of 2 minutes
- D. Seamless single sign-on together with pass-through authentication agents on-premises

**Answer:** B

**Explanation:** Password writeback, enabled in Microsoft Entra Connect (or cloud sync) and in the SSPR on-premises integration settings, writes cloud password changes back to Active Directory. Password hash synchronization flows hashes from on-premises to the cloud only, so changing its interval does not help. Seamless SSO and pass-through authentication affect sign-in, not where a reset password is stored. Staged rollout moves users to cloud authentication but does not write passwords back.

### Question 4 of 10 (choose 2)

You configure a lifecycle management policy that should delete blob versions older than 90 days and move current blobs not modified for 30 days to the Cool tier. Which two rule actions should the policy include? (Choose two.)

- A. A baseBlob action with delete after daysAfterLastAccessTimeGreaterThan 90
- B. A baseBlob action with tierToCool after daysAfterModificationGreaterThan 30
- C. A version action with enableAutoTierToHotFromCool after 90 days
- D. A version action with delete after daysAfterCreationGreaterThan 90
- E. A snapshot action with tierToArchive after 30 days

**Answer:** B, D

**Explanation:** Lifecycle rules use the version action block for previous versions, with delete based on days after creation, and the baseBlob block for current blobs, with tierToCool based on days after modification. A snapshot action targets snapshots, not current blobs, and archives rather than cools. Deleting base blobs by last access deletes current data rather than old versions. enableAutoTierToHotFromCool applies to base blobs that are read, not to deleting versions.

### Question 5 of 10

A company needs its storage account data to survive the loss of an entire Azure region and the failure of a single datacenter (availability zone) in the primary region. It does not need read access to the secondary region during normal operation. Which redundancy option meets the requirements at the lowest cost?

- A. Geo-redundant storage (GRS)
- B. Zone-redundant storage (ZRS)
- C. Read-access geo-zone-redundant storage (RA-GZRS)
- D. Geo-zone-redundant storage (GZRS)

**Answer:** D

**Explanation:** GZRS copies data synchronously across three availability zones in the primary region and asynchronously to the paired secondary region, so it survives both a zone (datacenter) failure and a regional outage. GRS keeps its three primary copies with LRS, inside one datacenter, so a datacenter failure takes the primary copy offline. ZRS protects against a zone failure but never leaves the primary region. RA-GZRS gives the same protection plus read access to the secondary region, which the scenario does not need, so it costs more.

### Question 6 of 10

A Linux VM must have all data cached on the host and temporary disks encrypted end to end with platform-managed keys, without using DM-Crypt inside the guest. What should you enable?

- A. Azure Disk Encryption with Key Vault
- B. Encryption at host for the VM
- C. Confidential disk encryption on Gen1
- D. A disk encryption set with CMK only

**Answer:** B

**Explanation:** Encryption at host encrypts temp disks and OS/data disk caches on the VM host, with data flowing encrypted to the Storage service, and does not use guest-level encryption. Azure Disk Encryption uses DM-Crypt inside Linux guests, which is not wanted. A disk encryption set with customer-managed keys encrypts disks at rest in storage but does not cover the temp disk and host caches by itself. Confidential disk encryption requires confidential VM sizes, which are Generation 2.

### Question 7 of 10

An ARM template deploys a VM, and the parameter file must pass the local administrator password, which is stored as a secret in Azure Key Vault. Deployment fails with an error that the key vault cannot be accessed. The deploying user has get permissions on secrets. What must you change?

- A. Enable the vault's access for Azure Disk Encryption for volume encryption
- B. Enable the vault's access for Azure Resource Manager for template deployment
- C. Move the key vault into the same resource group as the virtual machine
- D. Assign the Key Vault Crypto User role to the deploying user on the key vault resource

**Answer:** B

**Explanation:** To reference a Key Vault secret from a parameter file, the vault must have the enabledForTemplateDeployment setting turned on, which lets Resource Manager retrieve the secret during deployment. The disk encryption setting is for Azure Disk Encryption, not template deployment. Crypto User concerns keys, not secrets, and the user already can read secrets. The vault can be in a different resource group or subscription in the same tenant.

### Question 8 of 10 (choose 2)

You must allow inbound HTTPS from the internet to web VMs in a subnet and allow those VMs to reach Azure SQL Database in the same region, while blocking all other outbound internet traffic. Which two NSG rules should you add? (Choose two.)

- A. Inbound allow TCP 443 from Internet to the web VMs
- B. Outbound allow all traffic to the Internet service tag at priority 100
- C. Inbound deny TCP 443 from the VirtualNetwork service tag
- D. Outbound allow TCP 1433 to the Sql.<region> service tag, above a deny to Internet
- E. Inbound allow all traffic from the AzureCloud service tag

**Answer:** A, D

**Explanation:** An inbound allow for TCP 443 from the Internet tag permits HTTPS to the web VMs, and an outbound allow to the regional Sql service tag with higher priority than an outbound deny to Internet permits database traffic while blocking other internet destinations. Allowing all outbound internet traffic violates the requirement. Allowing everything from AzureCloud opens the VMs to all Azure customers. Denying 443 from VirtualNetwork does not address either requirement.

### Question 9 of 10

Administrators must connect to Windows and Linux VMs over RDP and SSH from the Azure portal without assigning public IP addresses to the VMs and without exposing RDP or SSH ports to the internet. What should you deploy?

- A. A NAT gateway associated with the VM subnets
- B. Azure Bastion in a subnet named AzureBastionSubnet
- C. A point-to-site VPN on the existing virtual network gateway
- D. A public load balancer with inbound NAT rules

**Answer:** B

**Explanation:** Azure Bastion provides browser-based RDP and SSH over TLS from the portal, and it must be deployed into a dedicated subnet named AzureBastionSubnet; VMs need no public IPs. A NAT gateway only handles outbound connectivity. Inbound NAT rules on a public load balancer expose RDP and SSH ports to the internet. A point-to-site VPN avoids public ports but requires client configuration and does not provide portal-based connectivity.

### Question 10 of 10

An alert must fire when any VM in a subscription is deallocated by a user. Which alert type should you create?

- A. Smart detection alert from Application Insights
- B. Activity log alert on the deallocate operation
- C. Log search alert on the Heartbeat table
- D. Metric alert on the Percentage CPU metric

**Answer:** B

**Explanation:** Deallocating a VM is a control-plane operation recorded in the activity log, so an activity log alert on Microsoft.Compute/virtualMachines/deallocate/action matches it. A CPU metric alert reacts to performance and cannot tell a deallocation from low load. A missing heartbeat could also be caused by a crash or network issue and does not identify the user action. Smart detection analyzes application telemetry.

Ready for a timed run? Take the free 15-question AZ-104 mini exam: https://devopscodelab.com/app/exams/microsoft-az-104/mini/

DevOpsCode Lab is not affiliated with Microsoft. AZ-104 and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
