Courseiva
Deploy and Manage Azure ComputeeasyMultiple ChoiceObjective-mapped

AZ-104 Deploy and Manage Azure Compute Practice Question

You are creating a new Ubuntu VM and want it to create a local admin account and install packages automatically on the first boot. Which approach should you use?

⚠ Common exam trap

It's easy for candidates to confuse availability sets with orchestration features or assume snapshots can trigger automation, missing that cloud-init is the Azure-native solution for first-boot configuration in Linux.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use cloud-init to run first-boot configuration in Linux.

Cloud-init is the standard method for automating first-boot configuration on Linux VMs in Azure. It processes user-data (such as cloud-config YAML) to create users, install packages, and run scripts during initial boot, making it the correct choice for creating a local admin account and installing packages automatically.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use an availability set so the script runs during placement.

    Why it's wrong here

    An availability set is a logical grouping of VMs that distributes them across fault and update domains to improve resilience against hardware failures and Azure maintenance. It is purely a placement construct and has no capability to execute scripts or run configuration tasks when a VM is provisioned or placed. Therefore, using an availability set does not cause any first-boot script to run, and the requirement for automated local user creation would remain unmet.

    When this WOULD be correct

    When the question asks for a method to ensure that two or more VMs are not placed on the same physical hardware or are updated simultaneously to maintain application availability during planned or unplanned maintenance.

  • Use cloud-init to run first-boot configuration in Linux.

    Why this is correct

    cloud-init is the standard Linux first-boot provisioning tool, supported natively by Azure. By supplying a cloud-init script (in YAML or shell) at VM creation, you can automate creating local users with SSH keys, installing packages, running arbitrary commands, and applying system settings automatically on the first boot—before the OS is fully available for login. This directly fulfills the requirement to create a local user and configure the VM without manual intervention, making it the correct option.

  • Use a snapshot of the operating system disk.

    Why it's wrong here

    A snapshot is a point-in-time copy of the operating system disk, used primarily for backup or to create a new VM from an existing disk state. When you boot a VM from a snapshot, it simply restores that exact disk content; no configuration script or first-boot process is triggered. Thus, while a snapshot captures the filesystem, it lacks any execution mechanism to create users or install packages automatically, so you would still need to log in manually to perform those tasks.

  • Use a custom image and manually log in later.

    Why it's wrong here

    A custom image captures a pre-configured OS disk state, including any existing users or packages, but it does not include any first-boot provisioning logic. When you create a VM from that image, the VM boots directly to that state without running setup scripts, so you must manually SSH in and run commands to create a local user. This manual step violates the automation requirement, making the custom image approach incomplete for automatic first-boot configuration.

    When this WOULD be correct

    If the question asked for a method to deploy a VM with pre-configured software and settings that require manual post-deployment steps, such as compliance verification or custom application setup, using a custom image and logging in later would be appropriate.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.

Use cloud-init to run first-boot configuration in Linux.Correct answer

Why this is correct

cloud-init is the standard Linux first-boot provisioning tool, supported natively by Azure. By supplying a cloud-init script (in YAML or shell) at VM creation, you can automate creating local users with SSH keys, installing packages, running arbitrary commands, and applying system settings automatically on the first boot—before the OS is fully available for login. This directly fulfills the requirement to create a local user and configure the VM without manual intervention, making it the correct option.

Use an availability set so the script runs during placement.Wrong answer — click to see why

Why this is wrong here

An availability set ensures high availability by distributing VMs across fault and update domains, but it does not execute scripts or automate first-boot configuration.

★ When this WOULD be the correct answer

When the question asks for a method to ensure that two or more VMs are not placed on the same physical hardware or are updated simultaneously to maintain application availability during planned or unplanned maintenance.

Why candidates choose this

Candidates may confuse availability sets with automation features, thinking that placing a VM in an availability set triggers configuration scripts, or they may overestimate the capabilities of availability sets.

Use a custom image and manually log in later.Wrong answer — click to see why

Why this is wrong here

Manually logging in later does not automate the creation of a local admin account or package installation on first boot; cloud-init is designed for that purpose.

★ When this WOULD be the correct answer

If the question asked for a method to deploy a VM with pre-configured software and settings that require manual post-deployment steps, such as compliance verification or custom application setup, using a custom image and logging in later would be appropriate.

Why candidates choose this

Candidates might think that using a custom image is a valid way to pre-configure a VM, overlooking that cloud-init provides automated first-boot configuration without manual intervention.

Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

About these practice questions

One of 1,049 original AZ-104 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-104 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-104 exam.