Question

Difficulty: MediumImplement Azure Queue Storage Solutions

You are designing a web application that allows users to upload profile pictures. After a user uploads an image, the application needs to add a processing message to an Azure Queue Storage queue. The message must contain the user's metadata and a reference to the image. Which of the following approaches should you use to implement this queue solution securely and efficiently while staying within Azure Queue Storage limits?

  1. Store the profile picture in Azure Blob Storage, create a queue message containing the Blob URI and user metadata ensuring the total message size is under 64 KB, and authenticate the application using a managed identity assigned the Storage Queue Data Message Sender role.Answer
  2. B
    Embed the base64-encoded profile picture binary data directly in the queue message body along with the user metadata, ensuring the queue message does not exceed 256 KB.
  3. C
    Store the profile picture in Azure Blob Storage, and include a Shared Access Signature (SAS) token in the queue message body that grants full read, write, and delete permissions to the storage account with a 1-year expiration to ensure the worker has access.
  4. D
    Store the profile picture in Azure Blob Storage, and configure the application to use a system-assigned managed identity, exporting its client secret to authenticate the QueueClient from the client-side browser application.

Answer

Store the profile picture in Azure Blob Storage, create a queue message containing the Blob URI and user metadata ensuring the total message size is under 64 KB, and authenticate the application using a managed identity assigned the Storage Queue Data Message Sender role.
The correct approach stores the large file (profile picture) in Azure Blob Storage and keeps the queue message size below the 64 KB limit by only including the URI and user metadata. Authenticating via managed identity with the Storage Queue Data Message Sender role ensures secure and credential-free interaction with Azure Queue Storage following least privilege access control.

Step-by-Step Solution

1
Analyze size constraints for the queue message payload.
Determine that since profile pictures can easily exceed 64 KB, the image must be stored externally in Azure Blob Storage, and only a reference (URI) should be stored in the queue message.
Azure Queue Storage has a strict maximum message size of 64 KB.
2
Select the appropriate security and identity mechanism.
Use Azure Active Directory (Microsoft Entra ID) authentication with a managed identity assigned to the Storage Queue Data Message Sender role.
This implements secure, credential-free authentication with the least privilege required to write to the queue.

Key Concept

Azure Queue Storage message size limits and secure access configuration
Rate this question