You are developing an Azure-hosted application that processes large batch PDF generation requests. Each request contains user preferences and a raw list of data records to include. The size of the request payload ranges from 10 KB to 500 KB. You plan to use Azure Queue Storage to process these requests asynchronously using a background worker. You need to design the solution to handle the request payloads while minimizing costs and ensuring reliability. Which approach should you implement to handle the request payloads?
- ASend the payload directly to the queue using QueueClient.SendMessageAsync. Configure the storage account to use the Premium tier (SSD-based) to increase the queue's maximum message size to 1 MB.
- BCreate a system-assigned managed identity for the application, assign the Storage Queue Data Message Sender role, and use it to authenticate the client. The Azure SDK automatically compresses and splits messages larger than 64 KB into metadata attributes when managed identities are used.
- Upload the request payload to an Azure Blob Storage container, write the URI of the blob as the message content to the Azure Queue Storage queue, and have the worker retrieve the payload from Blob Storage and delete the blob after processing.Cevap
- DGenerate a service-level Shared Access Signature (SAS) token with write permissions for the queue, and include the SAS token in the queue message properties to authorize payload sizes up to 256 KB.
Cevap
Upload the request payload to an Azure Blob Storage container, write the URI of the blob as the message content to the Azure Queue Storage queue, and have the worker retrieve the payload from Blob Storage and delete the blob after processing.
The correct option is the one that uploads the payload to Azure Blob Storage and writes the blob's URI to the queue. Azure Queue Storage has a hard message size limit of 64 KB. For payloads exceeding this limit (such as requests ranging from 10 KB to 500 KB), the industry-standard pattern is to store the actual data in Blob Storage and pass a reference (such as the blob URI) in the queue message. The processing worker can then read the reference, retrieve the blob content, process it, and delete the blob.
Adım Adım Çözüm
Anahtar Kavram
Handling messages that exceed the 64 KB Azure Queue Storage size limit.