Azure Administrator · Domain 3 of 5 · 24% of the exam

Azure Administrator Domain 3: Deploy and Manage Azure Compute Resources

48 free practice questions for Deploy and Manage Azure Compute Resources in the Microsoft Azure Administrator Associate (AZ-104) exam. Try each question first, then open "Show answer" for the correct option and explanation.

Deploy and Manage Azure Compute Resources practice questions

  1. Question 1. You deploy the same ARM template repeatedly. Which deployment mode deletes resources in the group that are not in the template?

    1. Incremental mode
    2. Validate mode
    3. Complete mode
    4. What-if mode
    Show answer

    Answer: C. Complete mode

    Complete mode removes resources not defined in the template; incremental mode leaves them.

  2. Question 2. Which is the default ARM template deployment mode?

    1. Incremental
    2. Replace
    3. Rollback
    4. Complete
    Show answer

    Answer: A. Incremental

    Incremental mode adds or updates resources and leaves unlisted resources unchanged.

  3. Question 3. What does the what-if operation show before an ARM or Bicep deployment?

    1. The compliance state of each policy at the scope
    2. The estimated cost of every resource in the template
    3. The latency between regions used by the template
    4. The changes the deployment would make to existing resources
    Show answer

    Answer: D. The changes the deployment would make to existing resources

    What-if previews creates, modifies, and deletes without applying them.

  4. Question 4. In an ARM template, which section holds values supplied at deployment time, such as a VM size?

    1. outputs
    2. resources
    3. variables
    4. parameters
    Show answer

    Answer: D. parameters

    Parameters accept input values; variables hold values computed inside the template.

  5. Question 5. In an ARM template, what is the outputs section used for?

    1. Listing the API versions that are not allowed
    2. Declaring the resources that the template creates
    3. Storing secrets that are shared across templates
    4. Returning values, such as an IP address, after deployment
    Show answer

    Answer: D. Returning values, such as an IP address, after deployment

    Outputs return values from the deployment that can be used by scripts or other templates.

  6. Question 6. How should a template securely receive an admin password without storing it in the parameter file?

    1. Reference a Key Vault secret in the parameter file
    2. Put the password in the template's variables section
    3. Encode the password in Base64 in the outputs section
    4. Store the password in a resource tag on the VM
    Show answer

    Answer: A. Reference a Key Vault secret in the parameter file

    Parameter files can reference secrets in Key Vault that has template deployment access enabled.

  7. Question 7. Which command converts an existing ARM JSON template into Bicep?

    1. az group export
    2. az deployment group create
    3. az bicep build
    4. az bicep decompile
    Show answer

    Answer: D. az bicep decompile

    decompile converts JSON to Bicep; build compiles Bicep to ARM JSON.

  8. Question 8. Which Azure CLI command deploys a Bicep file to a resource group?

    1. az bicep publish --resource-group main
    2. az vm create --template-file main.bicep
    3. az deployment group create --template-file main.bicep
    4. az group create --template-file main.bicep
    Show answer

    Answer: C. az deployment group create --template-file main.bicep

    The deployment group create command accepts Bicep files directly.

  9. Question 9. How can you export a template for resources you already deployed through the portal?

    1. Use Azure Advisor recommendations
    2. Use Export template on the resource group
    3. Use Cost analysis grouped by resource
    4. Use the Activity log filter for deployments
    Show answer

    Answer: B. Use Export template on the resource group

    Export template generates an ARM template from existing resources or a deployment.

  10. Question 10. You need to change a running VM to a larger size. What might happen?

    1. The VM moves to a new region to find a larger size
    2. The VM may restart, and a deallocation may be needed if the size is unavailable
    3. The VM's data disks are deleted and must be restored from backup
    4. Nothing happens until the next monthly maintenance window
    Show answer

    Answer: B. The VM may restart, and a deallocation may be needed if the size is unavailable

    Resizing restarts the VM; if the cluster lacks the size, you must deallocate first.

  11. Question 11. Which option protects VMs from a datacenter failure within a region?

    1. Place all VMs in one proximity placement group
    2. Deploy VMs across availability zones
    3. Deploy VMs in one availability set
    4. Use a larger VM size with more cores
    Show answer

    Answer: B. Deploy VMs across availability zones

    Zones are separate datacenters; availability sets only protect within a datacenter.

  12. Question 12. What is the SLA benefit of deploying two or more VMs across availability zones in the same region?

    1. A 100% uptime guarantee for all VM disks
    2. The same SLA as one VM with standard HDD disks
    3. An SLA that covers only planned maintenance
    4. The highest VM uptime SLA, at 99.99%
    Show answer

    Answer: D. The highest VM uptime SLA, at 99.99%

    Two or more instances across zones get Microsoft's highest VM connectivity SLA.

  13. Question 13. Can you add an existing VM to an availability set?

    1. Yes, but only when the VM is running
    2. Yes, by moving it to a new resource group
    3. Yes, by editing the VM's availability setting
    4. No, the VM must be recreated in the availability set
    Show answer

    Answer: D. No, the VM must be recreated in the availability set

    Availability set membership is set at creation; you'd need to recreate the VM.

  14. Question 14. What does a VM scale set autoscale rule based on CPU do?

    1. Adds or removes instances when CPU crosses thresholds
    2. Moves instances to another region when CPU is high
    3. Restarts the scale set every time CPU exceeds 50%
    4. Resizes each instance to a larger size when busy
    Show answer

    Answer: A. Adds or removes instances when CPU crosses thresholds

    Scale sets scale out and in by changing instance count based on metrics or schedules.

  15. Question 15. Why should you configure a scale-in rule along with a scale-out rule?

    1. So the scale set never exceeds a single instance
    2. So the scale set deploys to a second region
    3. So instances are removed when load drops, reducing cost
    4. So the maximum instance count is ignored
    Show answer

    Answer: C. So instances are removed when load drops, reducing cost

    Without scale-in, the instance count stays high after demand falls.

  16. Question 16. Which scale set orchestration mode supports mixing VM sizes and managing VMs with standard VM APIs?

    1. Single placement mode
    2. Classic orchestration
    3. Flexible orchestration
    4. Uniform orchestration
    Show answer

    Answer: C. Flexible orchestration

    Flexible mode supports different VM types and standard VM operations.

  17. Question 17. How do you run a script inside a VM after deployment without signing in to it?

    1. Use Cost Management to schedule the script
    2. Use a CanNotDelete lock with a script tag
    3. Use Azure Advisor to push the script
    4. Use the Custom Script Extension or Run Command
    Show answer

    Answer: D. Use the Custom Script Extension or Run Command

    The Custom Script Extension downloads and runs scripts; Run Command executes scripts on demand.

  18. Question 18. What does Azure Disk Encryption use to encrypt a Windows VM's OS and data disks?

    1. TLS certificates from App Service
    2. BitLocker, with keys stored in Key Vault
    3. DM-Crypt only, without any key storage
    4. Storage service encryption with no keys
    Show answer

    Answer: B. BitLocker, with keys stored in Key Vault

    ADE uses BitLocker on Windows and DM-Crypt on Linux, integrated with Key Vault.

  19. Question 19. Which option encrypts VM temp disks and caches at the host, without using CPU inside the VM?

    1. Storage account firewall
    2. Azure Disk Encryption
    3. Encryption at host
    4. Client-side encryption
    Show answer

    Answer: C. Encryption at host

    Encryption at host encrypts data on the VM host so temp disks and caches are also encrypted.

  20. Question 20. Which managed disk type offers the highest performance with configurable IOPS and throughput?

    1. Ultra Disk
    2. Standard SSD
    3. Premium SSD v1 with bursting
    4. Standard HDD
    Show answer

    Answer: A. Ultra Disk

    Ultra Disks offer sub-millisecond latency and let you adjust IOPS and throughput.

  21. Question 21. A dev/test VM needs cheap storage and can tolerate lower performance. Which disk type fits?

    1. Ultra Disk
    2. Premium SSD
    3. Standard HDD
    4. Premium SSD v2
    Show answer

    Answer: C. Standard HDD

    Standard HDD is the lowest-cost managed disk option for non-critical workloads.

  22. Question 22. You need to move a VM to another region. Which service helps replicate and fail it over?

    1. Azure Site Recovery
    2. Azure Resource Graph
    3. Azure File Sync
    4. Azure Bastion
    Show answer

    Answer: A. Azure Site Recovery

    Site Recovery replicates VMs to another region and can be used for moves and disaster recovery.

  23. Question 23. Which feature lets you capture a VM's configuration to create more identical VMs?

    1. A budget attached to the VM
    2. An image stored in an Azure Compute Gallery
    3. A snapshot of the VM's tags
    4. An export of the Activity log
    Show answer

    Answer: B. An image stored in an Azure Compute Gallery

    Compute Gallery stores and replicates images and versions for creating VMs at scale.

  24. Question 24. Which App Service component determines compute resources, pricing tier, and region for apps?

    1. The custom domain
    2. The deployment slot
    3. The App Service plan
    4. The TLS certificate
    Show answer

    Answer: C. The App Service plan

    Apps run in an App Service plan that defines the VM size, instance count, and features.

  25. Question 25. You need a staging environment for an App Service app and to swap it into production with no downtime. What should you use?

    1. A second resource group
    2. A new App Service plan
    3. Availability zones
    4. Deployment slots
    Show answer

    Answer: D. Deployment slots

    Slots let you deploy to staging, warm up, and swap with production.

  26. Question 26. Which App Service tier is the minimum that supports deployment slots?

    1. Free
    2. Basic
    3. Standard
    4. Shared
    Show answer

    Answer: C. Standard

    Deployment slots are available in Standard, Premium, and Isolated tiers.

  27. Question 27. How do you let App Service scale out automatically based on CPU usage?

    1. Enable Always On in the app configuration
    2. Assign a custom domain with a new certificate
    3. Add a deployment slot for each new instance
    4. Configure autoscale rules on the App Service plan
    Show answer

    Answer: D. Configure autoscale rules on the App Service plan

    Scaling applies to the plan, so all apps in the plan scale together.

  28. Question 28. An App Service slot setting is marked as a deployment slot setting. What happens during a swap?

    1. The swap is blocked until the setting is removed
    2. The setting moves to production with the code
    3. The setting is deleted from both slots
    4. The setting stays with its slot instead of moving
    Show answer

    Answer: D. The setting stays with its slot instead of moving

    Slot-specific settings (sticky settings) don't swap, which is useful for connection strings.

  29. Question 29. Which is required to add a custom domain such as www.contoso.com to an App Service app?

    1. A new Microsoft Entra tenant for the domain
    2. A DNS record (CNAME or TXT) to verify domain ownership
    3. A storage account in the same region as the app
    4. A virtual machine running a DNS server role
    Show answer

    Answer: B. A DNS record (CNAME or TXT) to verify domain ownership

    App Service verifies domain ownership through DNS records before binding the domain.

  30. Question 30. An App Service app must reach a database in a virtual network. Which feature enables outbound access to the VNet?

    1. Hybrid Connections only
    2. Deployment slots
    3. Access restrictions
    4. VNet integration
    Show answer

    Answer: D. VNet integration

    VNet integration lets the app make outbound calls into a virtual network.

  31. Question 31. What do App Service access restrictions control?

    1. Which inbound IP addresses or networks can reach the app
    2. Which users can publish code to the app
    3. Which regions the app can be deployed to
    4. Which outbound ports the app can use to call APIs
    Show answer

    Answer: A. Which inbound IP addresses or networks can reach the app

    Access restrictions define allow/deny rules for inbound traffic to the app.

  32. Question 32. How can you back up an App Service app's content and configuration?

    1. Export the app's activity log to Log Analytics
    2. Enable Always On for the App Service plan
    3. Use the built-in backup feature to a storage account
    4. Create a CanNotDelete lock on the App Service
    Show answer

    Answer: C. Use the built-in backup feature to a storage account

    App Service backups save configuration, files, and connected databases to storage.

  33. Question 33. Which service runs a container group with multiple containers sharing a network and lifecycle?

    1. Azure Compute Gallery
    2. Azure Container Instances
    3. Azure Batch pool
    4. Azure App Service plan
    Show answer

    Answer: B. Azure Container Instances

    Container groups in ACI are like pods: containers share the host, network, and storage.

  34. Question 34. Which service stores and manages private container images for deployments?

    1. Azure DevTest Labs
    2. Azure Container Registry
    3. Azure Compute Gallery
    4. Azure Blob archive tier
    Show answer

    Answer: B. Azure Container Registry

    Container Registry is a managed private registry based on Docker Registry 2.0.

  35. Question 35. Which Azure Container Registry tier supports geo-replication across regions?

    1. Standard
    2. Basic
    3. Premium
    4. Classic
    Show answer

    Answer: C. Premium

    Geo-replication is a Premium-only feature for serving images close to deployments.

  36. Question 36. How can Azure Container Apps pull images from a private registry without storing passwords?

    1. Store the admin password in an environment variable
    2. Make the container registry public
    3. Use a managed identity with the AcrPull role
    4. Put the image in an App Service slot
    Show answer

    Answer: C. Use a managed identity with the AcrPull role

    Managed identities with AcrPull let the app pull images securely.

  37. Question 37. What makes Azure Container Apps scale based on events such as queue length?

    1. App Service autoscale profiles
    2. Built-in KEDA scale rules
    3. Availability set update domains
    4. Virtual machine scale set rules
    Show answer

    Answer: B. Built-in KEDA scale rules

    Container Apps uses KEDA to scale on HTTP traffic, events, CPU, memory, and more, including to zero.

  38. Question 38. What is the purpose of a Container Apps environment?

    1. A billing account that groups container registries
    2. A secure boundary where container apps share a network and logs
    3. A VM image used to host containers on-premises
    4. A pricing tier that sets the size of each container
    Show answer

    Answer: B. A secure boundary where container apps share a network and logs

    Apps in the same environment share a virtual network and Log Analytics workspace.

  39. Question 39. Which Azure CLI command creates a new VM?

    1. az compute new
    2. az group vm add
    3. az vm deploy
    4. az vm create
    Show answer

    Answer: D. az vm create

    az vm create provisions a VM with options for image, size, and credentials.

  40. Question 40. Which PowerShell cmdlet creates a new Azure VM?

    1. Set-AzVMNew
    2. Create-AzVM
    3. Add-AzVM
    4. New-AzVM
    Show answer

    Answer: D. New-AzVM

    New-AzVM is part of the Az.Compute module.

  41. Question 41. What is required to connect to a Linux VM using SSH keys created in the portal?

    1. The private key downloaded when the key pair was generated
    2. The storage account key for the VM's boot diagnostics
    3. The Microsoft Entra tenant ID of the subscription
    4. A user delegation SAS for the VM's OS disk
    Show answer

    Answer: A. The private key downloaded when the key pair was generated

    The portal creates the key pair and gives you the private key once; Azure stores only the public key.

  42. Question 42. What does boot diagnostics provide for a VM?

    1. A backup of the VM's data disks to a vault
    2. A list of all users who signed in to the VM
    3. Automatic scaling based on CPU usage
    4. Screenshots and serial log output to troubleshoot boot failures
    Show answer

    Answer: D. Screenshots and serial log output to troubleshoot boot failures

    Boot diagnostics help debug VMs that fail to start by showing console output.

  43. Question 43. Which feature lets you run VMs on physical servers dedicated to your subscription for compliance?

    1. Availability zones
    2. Azure Spot Virtual Machines
    3. Proximity placement groups
    4. Azure Dedicated Host
    Show answer

    Answer: D. Azure Dedicated Host

    Dedicated Host gives you physical servers not shared with other customers.

  44. Question 44. What is a proximity placement group used for?

    1. Placing VMs physically close together for low latency
    2. Placing VMs in different regions for resilience
    3. Grouping VMs to apply the same Azure Policy
    4. Grouping VMs so they share one billing account
    Show answer

    Answer: A. Placing VMs physically close together for low latency

    Proximity placement groups reduce network latency between VMs.

  45. Question 45. How can you add storage capacity to a running VM without affecting the OS disk?

    1. Resize the temporary disk
    2. Enable boot diagnostics on the VM
    3. Increase the VM's number of NICs
    4. Attach a new managed data disk
    Show answer

    Answer: D. Attach a new managed data disk

    Data disks can be attached to running VMs and then initialized in the OS.

  46. Question 46. What should you remember about the temporary disk on an Azure VM?

    1. It is billed separately at the premium SSD rate
    2. It is the only disk that supports encryption
    3. Data on it can be lost during maintenance or redeployment
    4. It is replicated to a paired region automatically
    Show answer

    Answer: C. Data on it can be lost during maintenance or redeployment

    The temp disk is local to the host and is not persistent; don't store important data there.

  47. Question 47. Which feature can move a VM to a different host to fix an issue, keeping its disks?

    1. Redeploy
    2. Reapply
    3. Generalize
    4. Capture
    Show answer

    Answer: A. Redeploy

    Redeploy moves the VM to a new node in the Azure infrastructure; temp disk data is lost.

  48. Question 48. Before capturing a generalized VM image of Windows, what must you run?

    1. chkdsk to check the disk for errors
    2. gpupdate to refresh group policies
    3. Disk Cleanup to delete temporary files
    4. Sysprep to remove machine-specific information
    Show answer

    Answer: D. Sysprep to remove machine-specific information

    Generalizing removes unique info such as the computer SID so the image can create many VMs.

Microsoft and Azure are trademarks of the Microsoft group of companies. These questions are original study material, not questions from the real exam.