Courseiva
Question 387 of 881
Implement Azure securitymediumMultiple ChoiceObjective-mapped

AZ-204 Implement Azure security Practice Question

You are developing a web application that will be deployed to Azure App Service. The application allows users to upload files, which are stored in Azure Blob Storage. You need to ensure that only authenticated users can upload files and that each user can only see their own files. You plan to use shared access signatures (SAS) for secure access. The application uses Microsoft Entra ID for authentication. You want to generate SAS tokens on the server after the user authenticates. Which approach should you use?

⚠ Common exam trap

Test-takers frequently confuse a service SAS (which uses the account key and can scope to a container or blob) with a user delegation SAS (which uses Entra ID and supports finer-grained identity-based scoping), leading them to choose Option C because it seems simpler, but they miss the security and isolation requirements.

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

After user authentication, use the server-side code to generate a user delegation SAS for a specific blob container path that includes the user's identifier. Store the SAS in the user's session and return it to the client. The client then uses the SAS to upload the file directly to Blob Storage.

It uses a user delegation SAS, which is signed with the storage account's user delegation key derived from Microsoft Entra ID credentials. This ensures that the SAS token is scoped to the authenticated user's identity and can be restricted to a specific container path (e.g., a folder named after the user's identifier). The server generates the SAS after authentication, stores it in the session, and returns it to the client, allowing direct uploads to Blob Storage without exposing the storage account key.

Answer analysis

Option-by-option breakdown

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

  • After user authentication, have the client generate a SAS token using the storage account key retrieved from a secure endpoint.

    Why it's wrong here

    The storage account key grants full administrative access to the entire storage account. If this key is ever exposed to the client-side code, even temporarily or through a 'secure endpoint' that then passes it to the client for SAS generation, it creates a severe security vulnerability. A malicious user could intercept or extract this key and gain unrestricted access to all containers, blobs, queues, and tables within the storage account, bypassing any intended access controls. This completely undermines the principle of least privilege and is an unacceptable security risk.

  • After user authentication, use the server-side code to generate a user delegation SAS for a specific blob container path that includes the user's identifier. Store the SAS in the user's session and return it to the client. The client then uses the SAS to upload the file directly to Blob Storage.

    Why this is correct

    This approach is correct because it leverages a User Delegation SAS, which is generated server-side using an Azure AD identity (not the storage account key) and provides fine-grained, time-limited permissions. By scoping the SAS to a specific blob container path incorporating the user's identifier, it ensures each user can only access their designated storage area, upholding data isolation and the principle of least privilege. The client receives only the SAS token, enabling direct and secure uploads to Blob Storage without the server acting as an intermediary or exposing sensitive credentials.

  • After user authentication, use the server-side code to generate a service SAS for the entire blob container. Return the SAS to the client. The client uploads the file, and the server later moves the file to a user-specific folder.

    Why it's wrong here

    Generating a service SAS for the entire blob container and returning it to the client grants that client broad access to all blobs within that container, not just their own. This violates the security principle of least privilege and the requirement that users should only see their own files, as a malicious user could potentially list, read, or overwrite other users' data. While the server might later move files, the initial broad access granted by the SAS is an unacceptable security risk, and the 'move later' strategy adds unnecessary complexity and latency.

  • After user authentication, use the server to upload the file to Blob Storage using the storage account key. Then return the URL of the uploaded blob to the client.

    Why it's wrong here

    While using the storage account key on the server is generally more secure than exposing it to the client, it still carries risks if the server-side code is compromised. More critically, having the server act as an intermediary for all file uploads introduces a significant scalability bottleneck. The server becomes responsible for receiving the entire file from the client, then re-uploading it to Blob Storage, consuming server resources (CPU, memory, network bandwidth) and increasing latency. This approach does not leverage the direct-to-storage capabilities of SAS tokens, which offload the upload burden from the application server.

Quick reference

Azure Blob Storage Tier Comparison

TierStorage CostRetrieval CostLatencyUse Case
HotHighestLowestImmediateActive data, frequent reads
CoolLowerHigherImmediateData accessed < once / month
ColdLower stillHigherImmediateData accessed < once / quarter
ArchiveLowestHighest + rehydration delayHoursLong-term compliance retention

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This AZ-204 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-204 exam.