Courseiva
Manage Azure Identities and GovernanceeasyMultiple ChoiceObjective-mapped

AZ-104 Manage Azure Identities and Governance Practice Question

An administrator wants a script running on an Azure VM to create a resource in Azure without storing any passwords or client secrets on the VM. What should the administrator configure first?

⚠ Common exam trap

Test-takers frequently confuse managed identities with service principals or think a public IP is needed for outbound authentication, but the IMDS endpoint works entirely within the Azure network without requiring a public IP.

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

A system-assigned managed identity on the VM

A system-assigned managed identity enables an Azure VM to authenticate to Azure services (e.g., Azure Resource Manager) without storing any credentials in the VM. The identity is automatically created and managed by Azure, and the VM can obtain an access token from Azure AD via the Instance Metadata Service (IMDS) endpoint (169.254.169.254) using a simple HTTP call. This allows the script to securely create resources without hardcoding passwords or client secrets.

Answer analysis

Option-by-option breakdown

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

  • A shared local account on the VM

    Why it's wrong here

    A shared local account resides in the VM's local Security Accounts Manager (SAM) database and grants interactive, RDP, or SSC logon to the operating system. It is not recognized by Azure AD and cannot authenticate to Azure control plane APIs such as resource creation endpoints. While a script running under that local account might have OS-level permissions, every Azure REST call would still require an Azure credential (like a managed identity or service principal). Thus, a local account only addresses OS access, never Azure-level authorization.

    When this WOULD be correct

    This option would be correct if the question asked for a way to allow multiple users to access the VM with the same credentials, or if the scenario required a non-Azure-authenticated local account for legacy application compatibility.

  • A system-assigned managed identity on the VM

    Why this is correct

    A system-assigned managed identity creates an Azure AD identity directly associated with the VM lifecycle. When the script runs on the VM, it can obtain a token from the Azure Instance Metadata Service (IMDS) endpoint at 169.254.169.254, using that token to authenticate to Azure Resource Manager APIs without storing any secrets. After you assign a role to the identity (e.g., Contributor), the script can create Azure resources. This exactly satisfies the need for a secure, credential-free authentication mechanism.

  • An Azure Policy exemption

    Why it's wrong here

    An Azure Policy exemption is a governance construct that excludes specific resources or scopes from the evaluation of certain policy definitions. It does not create an identity, modify the VM's authentication context, or grant any permissions to the script. The Azure policy engine evaluates resource properties for compliance after resources are deployed; it is never involved in the authentication flow that a script uses to create resources. Therefore, an exemption cannot enable a script to authenticate or provision resources—it only skips compliance checks for existing resources.

    When this WOULD be correct

    When a question asks how to allow a specific resource to be excluded from an Azure Policy initiative (e.g., to bypass a compliance requirement) without modifying the policy itself, an exemption would be the correct answer.

  • A public IP address on the VM

    Why it's wrong here

    A public IP address is a network resource that enables inbound and outbound internet connectivity for the VM. It does not carry any identity, token, or shared secret, and it cannot be used to authenticate to Azure Resource Manager. Even if the script reaches Azure endpoints over the public IP, it still lacks a security principal to prove its authorization. Therefore, a public IP has no bearing on the script's ability to create resources.

    When this WOULD be correct

    If the question were about ensuring a VM can be accessed from the internet or needs outbound connectivity to Azure services without a NAT gateway, then assigning a public IP address would be correct.

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.

A system-assigned managed identity on the VMCorrect answer

Why this is correct

A system-assigned managed identity creates an Azure AD identity directly associated with the VM lifecycle. When the script runs on the VM, it can obtain a token from the Azure Instance Metadata Service (IMDS) endpoint at 169.254.169.254, using that token to authenticate to Azure Resource Manager APIs without storing any secrets. After you assign a role to the identity (e.g., Contributor), the script can create Azure resources. This exactly satisfies the need for a secure, credential-free authentication mechanism.

A shared local account on the VMWrong answer — click to see why

Why this is wrong here

A shared local account on the VM would require storing credentials (username/password) on the VM, which violates the requirement to avoid storing passwords or client secrets. Managed identities provide a password-free authentication method.

★ When this WOULD be the correct answer

This option would be correct if the question asked for a way to allow multiple users to access the VM with the same credentials, or if the scenario required a non-Azure-authenticated local account for legacy application compatibility.

Why candidates choose this

Candidates may think a shared local account is a simple way to authenticate without Azure AD, overlooking that it still requires storing secrets on the VM.

An Azure Policy exemptionWrong answer — click to see why

Why this is wrong here

An Azure Policy exemption is used to exclude specific resources from policy evaluation, not to provide authentication credentials for a script to create resources.

★ When this WOULD be the correct answer

When a question asks how to allow a specific resource to be excluded from an Azure Policy initiative (e.g., to bypass a compliance requirement) without modifying the policy itself, an exemption would be the correct answer.

Why candidates choose this

Candidates may confuse 'exemption' with 'authentication' or think that an exemption allows the VM to bypass security controls to create resources.

A public IP address on the VMWrong answer — click to see why

Why this is wrong here

A public IP address is used for network connectivity, not for authentication or authorization. It does not eliminate the need for storing credentials, as the script would still require secrets to authenticate to Azure.

★ When this WOULD be the correct answer

If the question were about ensuring a VM can be accessed from the internet or needs outbound connectivity to Azure services without a NAT gateway, then assigning a public IP address would be correct.

Why candidates choose this

Candidates may think a public IP is necessary for the VM to communicate with Azure Resource Manager APIs, but managed identities handle authentication without exposing the VM to the internet.

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?”

Go deeper

Related to this question

About these practice questions

Courseiva writes every AZ-104 question from scratch — 1,049 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.