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?
- 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
- BEmbed 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.
- CStore 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.
- DStore 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
Key Concept
Azure Queue Storage message size limits and secure access configuration