Courseiva
Implement and Manage StoragemediumMultiple ChoiceObjective-mapped

AZ-104 Implement and Manage Storage Practice Question

You have a storage account named stlogs01. An application running on VM-App01 in Azure must access blobs in the account without storing account keys in code or configuration files. What should you use?

⚠ Common exam trap

Many exam-takers think a SAS token stored in a file is acceptable because it is not an account key, but the question explicitly prohibits storing any secrets in code or configuration files, and a SAS token is still a secret that must be protected.

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 managed identity for VM-App01 and Azure RBAC on the storage account.

Using a managed identity for VM-App01 allows the application to authenticate to Azure Storage without storing any credentials in code or configuration files. The managed identity is automatically managed by Azure AD, and you grant it access to the blob container using Azure RBAC (e.g., the Storage Blob Data Contributor role). This eliminates the need for account keys or shared access signatures.

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 access signature stored in a text file on VM-App01.

    Why it's wrong here

    Placing a SAS token in a text file is just another form of static credential storage: the file sits on the VM filesystem where malware or bad actors could read it, and the SAS itself is a bearer token that grants access to whoever possesses it. Even if you scope and expire the SAS, the application still depends on a secret artifact rather than an identity, and you must manually manage rotation, revocation, and storage. Because the token is not tied to VM-App01's identity, there is no native way to enforce Azure AD policies or audit which principal actually used it, leaving a security gap that a managed identity would close.

    When this WOULD be correct

    If the question required granting time-limited, delegated access to specific blobs without using Azure AD authentication, and the application could securely retrieve the SAS from a file (e.g., via Azure Key Vault or a secure configuration management system), then a shared access signature stored in a text file could be correct.

  • The storage account access key hard-coded in the application.

    Why it's wrong here

    Hard-coding the storage account access key in the application is fundamentally the same as embedding a super-admin password: the account key grants full control over the entire storage account (blobs, tables, queues, files, and any RBAC restrictions are bypassed), so a single exposed key can lead to data theft, deletion, or even cross-service compromise. Rotating that key requires a coordinated deployment to update the application, creating downtime or build-step complexity, and you cannot scope permissions in the same way RBAC rules do. This approach also forfeits the benefit of per-identity auditing, as every use of the key is indistinguishable from the account owner, making it a poor fit for least-privilege security.

    When this WOULD be correct

    In a scenario where the application runs in a trusted environment, the storage account access key is managed securely (e.g., via Azure Key Vault), and the question does not prohibit storing keys in code, using the access key directly might be acceptable for simplicity.

  • A managed identity for VM-App01 and Azure RBAC on the storage account.

    Why this is correct

    For the correct approach, configure a system-assigned managed identity on VM-App01 so the application acquires an Azure AD token automatically at runtime, then grant that identity the Storage Blob Data Contributor (or a minimally scoped custom) RBAC role at the storage account or container level. This completely removes secret management because the managed identity is the security principal, tokens are issued by Azure AD, and credentials are rotated automatically. Unlike keys or SAS, there is no embedded secret to leak, and access can be surgically revoked by removing the role assignment—making this the only option that satisfies a strict identity-based, no-secrets security requirement.

  • Anonymous public access for the blob container.

    Why it's wrong here

    Turning on anonymous public access for the blob container removes authentication entirely: any Internet user who discovers the container URL can read or list blobs without presenting an Azure AD token, a SAS, or an account key. This not only violates the implied requirement to secure application data but also can expose sensitive, business-critical files—especially since public access settings apply to the container at the storage account level and require careful review of every blob. Even if the container is used for non-critical content, the default recommendation is to disable anonymous access altogether unless the solution is explicitly designed as a static website or public dataset, so this option is categorically wrong for an application handling private data.

    When this WOULD be correct

    If the question asked for a method to allow public read access to blobs in a container for a website or public dataset, and security or authentication is not a concern, then enabling anonymous public access on the container 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 managed identity for VM-App01 and Azure RBAC on the storage account.Correct answer

Why this is correct

For the correct approach, configure a system-assigned managed identity on VM-App01 so the application acquires an Azure AD token automatically at runtime, then grant that identity the Storage Blob Data Contributor (or a minimally scoped custom) RBAC role at the storage account or container level. This completely removes secret management because the managed identity is the security principal, tokens are issued by Azure AD, and credentials are rotated automatically. Unlike keys or SAS, there is no embedded secret to leak, and access can be surgically revoked by removing the role assignment—making this the only option that satisfies a strict identity-based, no-secrets security requirement.

A shared access signature stored in a text file on VM-App01.Wrong answer — click to see why

Why this is wrong here

Storing a shared access signature in a text file on the VM still exposes credentials in a file, which violates the requirement to avoid storing account keys in code or configuration files. It also does not leverage Azure RBAC or managed identities for secure access.

★ When this WOULD be the correct answer

If the question required granting time-limited, delegated access to specific blobs without using Azure AD authentication, and the application could securely retrieve the SAS from a file (e.g., via Azure Key Vault or a secure configuration management system), then a shared access signature stored in a text file could be correct.

Why candidates choose this

Candidates may think a SAS is a secure way to grant access without exposing the account key, but they overlook that storing it in a file on the VM still constitutes a credential stored in a configuration file, which the question explicitly prohibits.

The storage account access key hard-coded in the application.Wrong answer — click to see why

Why this is wrong here

Hard-coding the storage account access key in the application violates the requirement to avoid storing keys in code or configuration files, and it poses a security risk if the code is exposed.

★ When this WOULD be the correct answer

In a scenario where the application runs in a trusted environment, the storage account access key is managed securely (e.g., via Azure Key Vault), and the question does not prohibit storing keys in code, using the access key directly might be acceptable for simplicity.

Why candidates choose this

Candidates may think that using the access key is straightforward and secure enough, not realizing that managed identities provide a more secure, keyless authentication method recommended by Azure.

Anonymous public access for the blob container.Wrong answer — click to see why

Why this is wrong here

Anonymous public access allows anyone on the internet to read blobs without authentication, which violates the requirement to restrict access to the application without storing keys.

★ When this WOULD be the correct answer

If the question asked for a method to allow public read access to blobs in a container for a website or public dataset, and security or authentication is not a concern, then enabling anonymous public access on the container would be correct.

Why candidates choose this

Candidates may think anonymous access is a simple way to avoid storing keys, but they overlook the security implications and the requirement that only the application should access the blobs.

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

Quick reference

Access Control Model Comparison

ModelAcronymWho Controls Access?Best For
Discretionary Access ControlDACResource ownerSmall teams, file shares
Mandatory Access ControlMACSystem / security labelsClassified govt / military
Role-Based Access ControlRBACAdministrator (via roles)Enterprise environments
Attribute-Based Access ControlABACPolicy engine (user + resource attributes)Fine-grained, dynamic policies
Rule-Based Access ControlRuBACSystem rules / ACLsFirewall rules, network ACLs

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.