AZ-305 Question 161
Single answerA company regularly receives PDF documents in Azure Blob Storage and needs to process these files in near real-time, extracting text using Azure Cognitive Services and storing the extracted text in Azure Cosmos DB. They want a cost-effective, event-driven architecture with minimal infrastructure management. Which solution would best meet these requirements?
- A
Implement an Azure Functions app with a Blob Storage trigger in the Consumption plan to call Cognitive Services and store results in Cosmos DB
- B
Use an Azure Container Instances container group with a custom script polling Blob Storage for new files
- C
Deploy a Windows virtual machine with a scheduled task to scan the Blob container for new documents
- D
Design an Azure Logic App with a Timer trigger to run every minute and process new files if found
Show answer and explanation
Correct answer: A
Explanation
Serverless solutions like Azure Functions in the Consumption plan automatically scale based on the number of events (Blob uploads, in this case) and allow integration with other Azure services, such as Cognitive Services and Cosmos DB. This approach minimizes both operational overhead and cost, as you only pay for executions rather than having to manage underlying compute infrastructure. For more details, refer to the official Azure Functions documentation on Blob Storage triggers: https://learn.microsoft.com/azure/azure-functions/functions-bindings-storage-blob-trigger.
- A. Correct.
Correct. Azure Functions with a Blob trigger in a Consumption plan is a fully serverless approach that scales automatically based on event volume, making it ideal for near real-time processing of incoming files. You can integrate the function with Azure Cognitive Services for text extraction and store results in Cosmos DB without managing infrastructure or worrying about idle costs.
- B. Incorrect.
Incorrect. Azure Container Instances (ACI) provides container-based compute on demand, but it still requires you to manage container orchestration, polling logic, and scheduling. This is less efficient and not fully event-driven compared to a Blob Storage trigger in Azure Functions.
- C. Incorrect.
Incorrect. A virtual machine results in additional overhead for maintenance, patching, and scaling. While you could schedule tasks to process files, this does not align with the requirement for a cost-effective, serverless, event-driven approach.
- D. Incorrect.
Incorrect. A Logic App timer trigger can handle scheduled jobs, but it is not truly event-driven in this scenario. You would either incur unnecessary extra runs if the timer is frequent or introduce delays if it’s too infrequent, making it less optimal for near real-time file processing.